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

Unified Diff: chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.h

Issue 419263002: Add ManagePasswordsDecoration and unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/ui/cocoa/location_bar/manage_passwords_decoration.h
diff --git a/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.h b/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.h
new file mode 100644
index 0000000000000000000000000000000000000000..31dde0a14370c8e773082c3ef682c8d41bb1a93e
--- /dev/null
+++ b/chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.h
@@ -0,0 +1,41 @@
+// Copyright 2014 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_UI_COCOA_LOCATION_BAR_MANAGE_PASSWORDS_DECORATION_H_
+#define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_MANAGE_PASSWORDS_DECORATION_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/compiler_specific.h"
+#include "chrome/browser/ui/cocoa/location_bar/image_decoration.h"
+#include "chrome/browser/ui/passwords/manage_passwords_icon.h"
+
+class CommandUpdater;
+
+// Manage passwords icon on the right side of the field. This appears when
+// password management is available on the current page.
+class ManagePasswordsDecoration : public ImageDecoration,
+ public ManagePasswordsIcon {
rohitrao (ping after 24h) 2014/07/31 12:35:19 The multiple inheritance bothers me (I think it's
dconnelly 2014/08/01 09:11:46 Done. But this is a good example of the style guid
+ public:
+ explicit ManagePasswordsDecoration(CommandUpdater* command_updater);
+ virtual ~ManagePasswordsDecoration();
+
+ // Implement |LocationBarDecoration|
+ virtual bool AcceptsMousePress() OVERRIDE;
+ virtual bool OnMousePressed(NSRect frame, NSPoint location) OVERRIDE;
+ virtual NSString* GetToolTip() OVERRIDE;
+ virtual NSPoint GetBubblePointInFrame(NSRect frame) OVERRIDE;
+
+ protected:
+ // Implement |ManagePasswordsIcon|
+ virtual void UpdateVisibleUI() OVERRIDE;
+
+ private:
+ // Shows the manage passwords bubble.
+ CommandUpdater* command_updater_; // Weak, owned by Browser.
+
+ DISALLOW_COPY_AND_ASSIGN(ManagePasswordsDecoration);
+};
+
+#endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_MANAGE_PASSWORDS_DECORATION_H_

Powered by Google App Engine
This is Rietveld 408576698