Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: chrome/browser/cocoa/location_bar/content_setting_decoration.h

Issue 2888014: [Mac] Convert content settings to LocationBarDecoration, cleanup. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: noop change aiming for a clean try run. Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/location_bar/content_setting_decoration.h
diff --git a/chrome/browser/cocoa/location_bar/content_setting_decoration.h b/chrome/browser/cocoa/location_bar/content_setting_decoration.h
new file mode 100644
index 0000000000000000000000000000000000000000..9ff6eda2fb6a45e4ba9ce060af540105023e3e04
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/content_setting_decoration.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef CHROME_BROWSER_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_
+#define CHROME_BROWSER_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_
+
+#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 {
+ public:
+ 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 OnMousePressed(NSRect frame);
+ virtual NSString* GetToolTip();
+
+ private:
+ void SetToolTip(NSString* tooltip);
+
+ scoped_ptr<ContentSettingImageModel> content_setting_image_model_;
+
+ LocationBarViewMac* owner_; // weak
+ Profile* profile_; // weak
+
+ scoped_nsobject<NSString> tooltip_;
+
+ DISALLOW_COPY_AND_ASSIGN(ContentSettingDecoration);
+};
+
+#endif // CHROME_BROWSER_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_

Powered by Google App Engine
This is Rietveld 408576698