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 "chrome/browser/profiles/profile_info_cache_observer.h" | 8 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
9 #include "components/signin/core/browser/signin_error_controller.h" | 9 #include "components/signin/core/browser/signin_error_controller.h" |
10 #include "ui/views/controls/button/label_button.h" | 10 #include "ui/views/controls/button/label_button.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 private: | 34 private: |
35 friend class ProfileChooserViewExtensionsTest; | 35 friend class ProfileChooserViewExtensionsTest; |
36 | 36 |
37 // ProfileInfoCacheObserver: | 37 // ProfileInfoCacheObserver: |
38 void OnProfileAdded(const base::FilePath& profile_path) override; | 38 void OnProfileAdded(const base::FilePath& profile_path) override; |
39 void OnProfileWasRemoved(const base::FilePath& profile_path, | 39 void OnProfileWasRemoved(const base::FilePath& profile_path, |
40 const base::string16& profile_name) override; | 40 const base::string16& profile_name) override; |
41 void OnProfileNameChanged(const base::FilePath& profile_path, | 41 void OnProfileNameChanged(const base::FilePath& profile_path, |
42 const base::string16& old_profile_name) override; | 42 const base::string16& old_profile_name) override; |
43 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; | |
44 void OnProfileSupervisedUserIdChanged( | 43 void OnProfileSupervisedUserIdChanged( |
45 const base::FilePath& profile_path) override; | 44 const base::FilePath& profile_path) override; |
46 | 45 |
47 // SigninErrorController::Observer: | 46 // SigninErrorController::Observer: |
48 void OnErrorChanged() override; | 47 void OnErrorChanged() override; |
49 | 48 |
50 // Called when the profile info cache has changed, which means we might | 49 // Called when the profile info cache has changed, which means we might |
51 // have to update the icon/text of the button. | 50 // have to update the icon/text of the button. |
52 void UpdateAvatarButtonAndRelayoutParent(); | 51 void UpdateAvatarButtonAndRelayoutParent(); |
53 | 52 |
54 Browser* browser_; | 53 Browser* browser_; |
55 | 54 |
56 // Whether the signed in profile has an authentication error. Used to display | 55 // Whether the signed in profile has an authentication error. Used to display |
57 // an error icon next to the button text. | 56 // an error icon next to the button text. |
58 bool has_auth_error_; | 57 bool has_auth_error_; |
59 | 58 |
60 // The icon displayed instead of the profile name in the local profile case. | 59 // The icon displayed instead of the profile name in the local profile case. |
61 // Different assets are used depending on the OS version. | 60 // Different assets are used depending on the OS version. |
62 gfx::ImageSkia generic_avatar_; | 61 gfx::ImageSkia generic_avatar_; |
63 | 62 |
64 // This is used to check if the bubble was showing during the mouse pressed | 63 // This is used to check if the bubble was showing during the mouse pressed |
65 // event. If this is true then the mouse released event is ignored to prevent | 64 // event. If this is true then the mouse released event is ignored to prevent |
66 // the bubble from reshowing. | 65 // the bubble from reshowing. |
67 bool suppress_mouse_released_action_; | 66 bool suppress_mouse_released_action_; |
68 | 67 |
69 DISALLOW_COPY_AND_ASSIGN(NewAvatarButton); | 68 DISALLOW_COPY_AND_ASSIGN(NewAvatarButton); |
70 }; | 69 }; |
71 | 70 |
72 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ | 71 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_ |
OLD | NEW |