Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package


// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.


#include "base/scoped_ptr.h"
#import "chrome/browser/cocoa/location_bar/image_decoration.h"
#include "chrome/common/content_settings_types.h"

// ContentSettingDecoration is used to display the content settings
// images on the current page.

class ContentSettingImageModel;
class LocationBarViewMac;
class Profile;
class TabContents;

class ContentSettingDecoration : public ImageDecoration {
  ContentSettingDecoration(ContentSettingsType settings_type,
                           LocationBarViewMac* owner,
                           Profile* profile);
  virtual ~ContentSettingDecoration();

  // Updates the image and visibility state based on the supplied TabContents.
  void UpdateFromTabContents(const TabContents* tab_contents);

  // Overridden from |LocationBarDecoration|
  virtual bool AcceptsMousePress() { return true; }
  virtual bool OnMousePressed(NSRect frame);
  virtual NSString* GetToolTip();

  // Helper to get where the bubble point should land.  Similar to
  // |PageActionDecoration| or |StarDecoration| (|LocationBarViewMac|
  // calls those).
  NSPoint GetBubblePointInFrame(NSRect frame);

  void SetToolTip(NSString* tooltip);

  scoped_ptr<ContentSettingImageModel> content_setting_image_model_;

  LocationBarViewMac* owner_;  // weak
  Profile* profile_;  // weak

  scoped_nsobject<NSString> tooltip_;



Generated by  Doxygen 1.6.0   Back to index