Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / passwords / manage_passwords_icon.h
blobd4760d42551bae34c44c0e95a74adf679139c747
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_ICON_H_
6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_ICON_H_
8 #include "base/basictypes.h"
9 #include "components/password_manager/core/common/password_manager_ui.h"
11 // Abstract base class for platform-specific password management icon views.
12 class ManagePasswordsIcon {
13 public:
14 // Get/set the icon's state. Implementations of this class must implement
15 // SetStateInternal to do reasonable platform-specific things to represent
16 // the icon's state to the user.
17 void SetState(password_manager::ui::State state);
18 password_manager::ui::State state() const { return state_; }
20 void SetActive(bool active);
21 bool active() const { return active_; }
23 protected:
24 // The ID of the icon and text resources that are currently displayed.
25 int icon_id_;
26 int tooltip_text_id_;
28 ManagePasswordsIcon();
29 ~ManagePasswordsIcon();
31 // Called from SetState() and SetActive() in order to do whatever
32 // platform-specific UI work is necessary.
33 virtual void UpdateVisibleUI() = 0;
35 // Called from SetState() iff the icon's state has changed.
36 virtual void OnChangingState() = 0;
38 private:
39 // Updates the resource IDs in response to state changes.
40 void UpdateIDs();
42 password_manager::ui::State state_;
43 bool active_;
45 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsIcon);
48 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_ICON_H_