• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_ICON_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_ICON_VIEW_H_
7 
8 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
9 #include "chrome/browser/ui/passwords/manage_passwords_icon.h"
10 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h"
11 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
12 #include "ui/views/controls/image_view.h"
13 
14 class CommandUpdater;
15 class ManagePasswordsUIController;
16 
17 // View for the password icon in the Omnibox.
18 class ManagePasswordsIconView : public ManagePasswordsIcon,
19                                 public BubbleIconView {
20  public:
21   explicit ManagePasswordsIconView(CommandUpdater* updater);
22   virtual ~ManagePasswordsIconView();
23 
24   // BubbleIconView:
25   virtual bool IsBubbleShowing() const OVERRIDE;
26   virtual void OnExecuting(BubbleIconView::ExecuteSource source) OVERRIDE;
27 
28 #if defined(UNIT_TEST)
icon_id()29   int icon_id() const { return icon_id_; }
tooltip_text_id()30   int tooltip_text_id() const { return tooltip_text_id_; }
31 #endif
32 
33  protected:
34   // ManagePasswordsIcon:
35   virtual void UpdateVisibleUI() OVERRIDE;
36 
37  private:
38   // The ID of the icon and text resources that are currently displayed.
39   int icon_id_;
40   int tooltip_text_id_;
41 
42   DISALLOW_COPY_AND_ASSIGN(ManagePasswordsIconView);
43 };
44 
45 #endif  // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_ICON_VIEW_H_
46