OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 9 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
| 10 #include "chrome/browser/ui/views/profiles/avatar_button_style.h" |
10 #include "components/signin/core/browser/signin_error_controller.h" | 11 #include "components/signin/core/browser/signin_error_controller.h" |
11 #include "ui/views/controls/button/label_button.h" | 12 #include "ui/views/controls/button/label_button.h" |
12 | 13 |
13 class Browser; | 14 class Browser; |
14 | 15 |
15 // Avatar button that displays the active profile's name in the caption area. | 16 // Avatar button that displays the active profile's name in the caption area. |
16 class NewAvatarButton : public views::LabelButton, | 17 class NewAvatarButton : public views::LabelButton, |
17 public ProfileInfoCacheObserver, | 18 public ProfileInfoCacheObserver, |
18 public SigninErrorController::Observer { | 19 public SigninErrorController::Observer { |
19 public: | 20 public: |
20 // Different button styles that can be applied. | |
21 enum AvatarButtonStyle { | |
22 THEMED_BUTTON, // Used in a themed browser window. | |
23 NATIVE_BUTTON, // Used in a native aero or metro window. | |
24 }; | |
25 | |
26 NewAvatarButton(views::ButtonListener* listener, | 21 NewAvatarButton(views::ButtonListener* listener, |
27 AvatarButtonStyle button_style, | 22 AvatarButtonStyle button_style, |
28 Browser* browser); | 23 Browser* browser); |
29 ~NewAvatarButton() override; | 24 ~NewAvatarButton() override; |
30 | 25 |
31 // Views::LabelButton | 26 // Views::LabelButton |
32 bool OnMousePressed(const ui::MouseEvent& event) override; | 27 bool OnMousePressed(const ui::MouseEvent& event) override; |
33 void OnMouseReleased(const ui::MouseEvent& event) override; | 28 void OnMouseReleased(const ui::MouseEvent& event) override; |
34 | 29 |
35 // Views | 30 // Views |
(...skipping 30 matching lines...) Expand all Loading... |
66 | 61 |
67 // This is used to check if the bubble was showing during the mouse pressed | 62 // This is used to check if the bubble was showing during the mouse pressed |
68 // event. If this is true then the mouse released event is ignored to prevent | 63 // event. If this is true then the mouse released event is ignored to prevent |
69 // the bubble from reshowing. | 64 // the bubble from reshowing. |
70 bool suppress_mouse_released_action_; | 65 bool suppress_mouse_released_action_; |
71 | 66 |
72 DISALLOW_COPY_AND_ASSIGN(NewAvatarButton); | 67 DISALLOW_COPY_AND_ASSIGN(NewAvatarButton); |
73 }; | 68 }; |
74 | 69 |
75 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ | 70 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ |
OLD | NEW |