summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/location_bar_view_mac.h
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 00:22:57 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 00:22:57 +0000
commit21449b3dc0ac325ab90bc1418bab8a7dda947f3e (patch)
tree2168f112369b027ed11f8c41d80b92ec7abe3b3a /chrome/browser/cocoa/location_bar_view_mac.h
parent65137ae3ba7912decf0a953721ad35e074195fe9 (diff)
downloadchromium_src-21449b3dc0ac325ab90bc1418bab8a7dda947f3e.zip
chromium_src-21449b3dc0ac325ab90bc1418bab8a7dda947f3e.tar.gz
chromium_src-21449b3dc0ac325ab90bc1418bab8a7dda947f3e.tar.bz2
Revert 29827 - Refactor securityicon code to a more general form, also more consistent with
the Windows implementation, in preparation for implementing page actions. BUG=14899, 22922, 12281 TEST=unit tests included Review URL: http://codereview.chromium.org/264037 TBR=pamg@google.com Review URL: http://codereview.chromium.org/333002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29847 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/location_bar_view_mac.h')
-rw-r--r--chrome/browser/cocoa/location_bar_view_mac.h77
1 files changed, 1 insertions, 76 deletions
diff --git a/chrome/browser/cocoa/location_bar_view_mac.h b/chrome/browser/cocoa/location_bar_view_mac.h
index bafcde0..e305544 100644
--- a/chrome/browser/cocoa/location_bar_view_mac.h
+++ b/chrome/browser/cocoa/location_bar_view_mac.h
@@ -84,82 +84,10 @@ class LocationBarViewMac : public AutocompleteEditController,
const bool show_search_hint,
NSImage* image);
- // Used to display a clickable icon in the location bar.
- class LocationBarImageView {
- public:
- explicit LocationBarImageView() : image_(nil),
- label_(nil),
- visible_(false) {}
- virtual ~LocationBarImageView() {}
-
- // Sets the image.
- void SetImage(NSImage* image);
-
- // Sets the label text, font, and color. |text| may be nil; |color| and
- // |font| are ignored if |text| is nil.
- void SetLabel(NSString* text, NSFont* baseFont, NSColor* color);
-
- // Sets the visibility. SetImage() should be called with a valid image
- // before the visibility is set to |true|.
- void SetVisible(bool visible);
-
- const NSImage* GetImage() const { return image_; }
- const NSAttributedString* GetLabel() const { return label_; }
- bool IsVisible() const { return visible_; }
-
- virtual bool OnMousePressed() = 0;
-
- private:
- scoped_nsobject<NSImage> image_;
-
- // The label shown next to the icon, or nil if none.
- scoped_nsobject<NSAttributedString> label_;
-
- bool visible_;
-
- DISALLOW_COPY_AND_ASSIGN(LocationBarImageView);
- };
-
- // SecurityImageView is used to display the lock or warning icon when the
- // current URL's scheme is https.
- class SecurityImageView : public LocationBarImageView {
- public:
- enum Image {
- LOCK = 0,
- WARNING
- };
-
- SecurityImageView(Profile* profile, ToolbarModel* model);
- virtual ~SecurityImageView();
-
- // Sets the image to the appropriate icon.
- void SetImageShown(Image image);
-
- // Shows the page info dialog.
- virtual bool OnMousePressed();
-
- private:
- // The lock icon shown when using HTTPS. Loaded lazily, the first time it's
- // needed.
- scoped_nsobject<NSImage> lock_icon_;
-
- // The warning icon shown when HTTPS is broken. Loaded lazily, the first
- // time it's needed.
- scoped_nsobject<NSImage> warning_icon_;
-
- Profile* profile_;
- ToolbarModel* model_;
-
- DISALLOW_COPY_AND_ASSIGN(SecurityImageView);
- };
-
private:
- // Sets the SSL icon we should be showing.
+ // Set the SSL icon we should be showing.
void SetSecurityIcon(ToolbarModel::Icon icon);
- // Sets the label for the SSL icon.
- void SetSecurityIconLabel();
-
scoped_ptr<AutocompleteEditViewMac> edit_view_;
CommandUpdater* command_updater_; // Weak, owned by Browser.
@@ -174,9 +102,6 @@ class LocationBarViewMac : public AutocompleteEditController,
// The user's desired disposition for how their input should be opened.
WindowOpenDisposition disposition_;
- // The view that shows the lock/warning when in HTTPS mode.
- SecurityImageView security_image_view_;
-
Profile* profile_;
ToolbarModel* toolbar_model_; // Weak, owned by Browser.