| Index: chrome/browser/ui/views/passwords/manage_passwords_icon_view.h
|
| diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.h b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.h
|
| index 7dd791c70f1ef1239f09b2bd97c56715aece9531..efcef5f034d46a5c0d648f70dcf1aa142992e29a 100644
|
| --- a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.h
|
| +++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.h
|
| @@ -7,42 +7,60 @@
|
|
|
| #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
|
| #include "chrome/browser/ui/passwords/manage_passwords_icon.h"
|
| +#include "chrome/browser/ui/views/location_bar/bubble_icon_view.h"
|
| #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
|
| #include "ui/views/controls/image_view.h"
|
|
|
| +class CommandUpdater;
|
| class ManagePasswordsBubbleUIController;
|
|
|
| // View for the password icon in the Omnibox.
|
| class ManagePasswordsIconView : public ManagePasswordsIcon,
|
| - public views::ImageView {
|
| + public BubbleIconView {
|
| public:
|
| // Clicking on the ManagePasswordsIconView shows a ManagePasswordsBubbleView,
|
| // which requires the current WebContents. Because the current WebContents
|
| // changes as the user switches tabs, it cannot be provided in the
|
| // constructor. Instead, a LocationBarView::Delegate is passed here so that it
|
| // can be queried for the current WebContents as needed.
|
| - explicit ManagePasswordsIconView(
|
| - LocationBarView::Delegate* location_bar_delegate);
|
| + ManagePasswordsIconView(LocationBarView::Delegate* location_bar_delegate,
|
| + CommandUpdater* command_updater);
|
| virtual ~ManagePasswordsIconView();
|
|
|
| // ManagePasswordsIcon:
|
| + //
|
| + // TODO(mkwst): Remove this once we get rid of the single call to
|
| + // ShowBubbleWithoutUserInteraction in ManagePasswordsBubbleUIController.
|
| virtual void ShowBubbleWithoutUserInteraction() OVERRIDE;
|
|
|
| + // BubbleIconView:
|
| + virtual bool IsBubbleShowing() const OVERRIDE;
|
| + virtual void OnExecuting(BubbleIconView::ExecuteSource source) OVERRIDE;
|
| +
|
| +#if defined(UNIT_TEST)
|
| + int icon_id() const { return icon_id_; }
|
| + int tooltip_text_id() const { return tooltip_text_id_; }
|
| +#endif
|
| +
|
| protected:
|
| // ManagePasswordsIcon:
|
| - virtual void SetStateInternal(ManagePasswordsIcon::State state) OVERRIDE;
|
| + virtual void UpdateVisibleUI() OVERRIDE;
|
|
|
| private:
|
| - // views::ImageView:
|
| - virtual bool GetTooltipText(const gfx::Point& p,
|
| - base::string16* tooltip) const OVERRIDE;
|
| - virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
|
| - virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
|
| - virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
|
| -
|
| // The delegate used to get the currently visible WebContents.
|
| LocationBarView::Delegate* location_bar_delegate_;
|
|
|
| + // The updater used to deliver commands to the browser; we'll use this to
|
| + // pop open the bubble when necessary.
|
| + //
|
| + // TODO(mkwst): Remove this once we get rid of the single call to
|
| + // ShowBubbleWithoutUserInteraction in ManagePasswordsBubbleUIController.
|
| + CommandUpdater* command_updater_;
|
| +
|
| + // The ID of the icon and text resources that are currently displayed.
|
| + int icon_id_;
|
| + int tooltip_text_id_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ManagePasswordsIconView);
|
| };
|
|
|
|
|