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 #import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 10 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 virtual ~ProfileInfoUpdateObserver() { | 67 virtual ~ProfileInfoUpdateObserver() { |
68 g_browser_process->profile_manager()-> | 68 g_browser_process->profile_manager()-> |
69 GetProfileInfoCache().RemoveObserver(this); | 69 GetProfileInfoCache().RemoveObserver(this); |
70 SigninErrorController* errorController = | 70 SigninErrorController* errorController = |
71 profiles::GetSigninErrorController(profile_); | 71 profiles::GetSigninErrorController(profile_); |
72 if (errorController) | 72 if (errorController) |
73 errorController->RemoveObserver(this); | 73 errorController->RemoveObserver(this); |
74 } | 74 } |
75 | 75 |
76 // ProfileInfoCacheObserver: | 76 // ProfileInfoCacheObserver: |
77 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE { | 77 virtual void OnProfileAdded(const base::FilePath& profile_path) override { |
78 [avatarController_ updateAvatarButtonAndLayoutParent:YES]; | 78 [avatarController_ updateAvatarButtonAndLayoutParent:YES]; |
79 } | 79 } |
80 | 80 |
81 virtual void OnProfileWasRemoved( | 81 virtual void OnProfileWasRemoved( |
82 const base::FilePath& profile_path, | 82 const base::FilePath& profile_path, |
83 const base::string16& profile_name) OVERRIDE { | 83 const base::string16& profile_name) override { |
84 [avatarController_ updateAvatarButtonAndLayoutParent:YES]; | 84 [avatarController_ updateAvatarButtonAndLayoutParent:YES]; |
85 } | 85 } |
86 | 86 |
87 virtual void OnProfileNameChanged( | 87 virtual void OnProfileNameChanged( |
88 const base::FilePath& profile_path, | 88 const base::FilePath& profile_path, |
89 const base::string16& old_profile_name) OVERRIDE { | 89 const base::string16& old_profile_name) override { |
90 [avatarController_ updateAvatarButtonAndLayoutParent:YES]; | 90 [avatarController_ updateAvatarButtonAndLayoutParent:YES]; |
91 } | 91 } |
92 | 92 |
93 virtual void OnProfileAvatarChanged( | 93 virtual void OnProfileAvatarChanged( |
94 const base::FilePath& profile_path) OVERRIDE { | 94 const base::FilePath& profile_path) override { |
95 [avatarController_ updateAvatarButtonAndLayoutParent:YES]; | 95 [avatarController_ updateAvatarButtonAndLayoutParent:YES]; |
96 } | 96 } |
97 | 97 |
98 virtual void OnProfileSupervisedUserIdChanged( | 98 virtual void OnProfileSupervisedUserIdChanged( |
99 const base::FilePath& profile_path) OVERRIDE { | 99 const base::FilePath& profile_path) override { |
100 [avatarController_ updateAvatarButtonAndLayoutParent:YES]; | 100 [avatarController_ updateAvatarButtonAndLayoutParent:YES]; |
101 } | 101 } |
102 | 102 |
103 // SigninErrorController::Observer: | 103 // SigninErrorController::Observer: |
104 virtual void OnErrorChanged() OVERRIDE { | 104 virtual void OnErrorChanged() override { |
105 SigninErrorController* errorController = | 105 SigninErrorController* errorController = |
106 profiles::GetSigninErrorController(profile_); | 106 profiles::GetSigninErrorController(profile_); |
107 if (errorController) | 107 if (errorController) |
108 [avatarController_ updateErrorStatus:errorController->HasError()]; | 108 [avatarController_ updateErrorStatus:errorController->HasError()]; |
109 } | 109 } |
110 | 110 |
111 private: | 111 private: |
112 Profile* profile_; | 112 Profile* profile_; |
113 AvatarBaseController* avatarController_; // Weak; owns this. | 113 AvatarBaseController* avatarController_; // Weak; owns this. |
114 | 114 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 227 } |
228 | 228 |
229 - (void)updateErrorStatus:(BOOL)hasError { | 229 - (void)updateErrorStatus:(BOOL)hasError { |
230 } | 230 } |
231 | 231 |
232 - (BaseBubbleController*)menuController { | 232 - (BaseBubbleController*)menuController { |
233 return menuController_; | 233 return menuController_; |
234 } | 234 } |
235 | 235 |
236 @end | 236 @end |
OLD | NEW |