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 "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.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/profiles/profile_avatar_icon_util.h" | 10 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 } | 134 } |
135 | 135 |
136 - (NSButton*)buttonView { | 136 - (NSButton*)buttonView { |
137 CHECK(button_.get()); // Subclasses must set this. | 137 CHECK(button_.get()); // Subclasses must set this. |
138 return button_.get(); | 138 return button_.get(); |
139 } | 139 } |
140 | 140 |
141 - (void)showAvatarBubble:(NSView*)anchor | 141 - (void)showAvatarBubble:(NSView*)anchor |
142 withMode:(BrowserWindow::AvatarBubbleMode)mode | 142 withMode:(BrowserWindow::AvatarBubbleMode)mode |
143 withServiceType:(signin::GAIAServiceType)serviceType { | 143 withServiceType:(signin::GAIAServiceType)serviceType { |
144 if (menuController_) | 144 if (menuController_) { |
145 if (switches::IsNewAvatarMenu()) { | |
146 profiles::BubbleViewMode viewMode; | |
147 profiles::TutorialMode tutorialMode; | |
148 profiles::BubbleViewModeFromAvatarBubbleMode( | |
149 mode, &viewMode, &tutorialMode); | |
150 if (tutorialMode != profiles::TUTORIAL_MODE_NONE) { | |
151 DCHECK([menuController_ isKindOfClass: | |
152 [ProfileChooserController class]]); | |
153 ProfileChooserController* profileChooserController = | |
154 static_cast<ProfileChooserController*>(menuController_); | |
Alexei Svitkine (slow)
2014/08/19 19:06:22
Use ObjCCast and remove the dcheck.
guohui
2014/08/19 19:51:03
Done.
| |
155 [profileChooserController setTutorialMode:tutorialMode]; | |
156 [profileChooserController initMenuContentsWithView:viewMode]; | |
157 } | |
158 } | |
145 return; | 159 return; |
160 } | |
146 | 161 |
147 DCHECK(chrome::IsCommandEnabled(browser_, IDC_SHOW_AVATAR_MENU)); | 162 DCHECK(chrome::IsCommandEnabled(browser_, IDC_SHOW_AVATAR_MENU)); |
148 | 163 |
149 NSWindowController* wc = | 164 NSWindowController* wc = |
150 [browser_->window()->GetNativeWindow() windowController]; | 165 [browser_->window()->GetNativeWindow() windowController]; |
151 if ([wc isKindOfClass:[BrowserWindowController class]]) { | 166 if ([wc isKindOfClass:[BrowserWindowController class]]) { |
152 [static_cast<BrowserWindowController*>(wc) | 167 [static_cast<BrowserWindowController*>(wc) |
153 lockBarVisibilityForOwner:self withAnimation:NO delay:NO]; | 168 lockBarVisibilityForOwner:self withAnimation:NO delay:NO]; |
154 } | 169 } |
155 | 170 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 } | 228 } |
214 | 229 |
215 - (void)updateErrorStatus:(BOOL)hasError { | 230 - (void)updateErrorStatus:(BOOL)hasError { |
216 } | 231 } |
217 | 232 |
218 - (BaseBubbleController*)menuController { | 233 - (BaseBubbleController*)menuController { |
219 return menuController_; | 234 return menuController_; |
220 } | 235 } |
221 | 236 |
222 @end | 237 @end |
OLD | NEW |