Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm

Issue 485073002: Migrate signin error messages to the new avatar bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 ProfileChooserController* profileChooserController =
152 base::mac::ObjCCastStrict<ProfileChooserController*>(
153 menuController_);
154 [profileChooserController setTutorialMode:tutorialMode];
155 [profileChooserController initMenuContentsWithView:viewMode];
156 }
157 }
145 return; 158 return;
159 }
146 160
147 DCHECK(chrome::IsCommandEnabled(browser_, IDC_SHOW_AVATAR_MENU)); 161 DCHECK(chrome::IsCommandEnabled(browser_, IDC_SHOW_AVATAR_MENU));
148 162
149 NSWindowController* wc = 163 NSWindowController* wc =
150 [browser_->window()->GetNativeWindow() windowController]; 164 [browser_->window()->GetNativeWindow() windowController];
151 if ([wc isKindOfClass:[BrowserWindowController class]]) { 165 if ([wc isKindOfClass:[BrowserWindowController class]]) {
152 [static_cast<BrowserWindowController*>(wc) 166 [static_cast<BrowserWindowController*>(wc)
153 lockBarVisibilityForOwner:self withAnimation:NO delay:NO]; 167 lockBarVisibilityForOwner:self withAnimation:NO delay:NO];
154 } 168 }
155 169
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 227 }
214 228
215 - (void)updateErrorStatus:(BOOL)hasError { 229 - (void)updateErrorStatus:(BOOL)hasError {
216 } 230 }
217 231
218 - (BaseBubbleController*)menuController { 232 - (BaseBubbleController*)menuController {
219 return menuController_; 233 return menuController_;
220 } 234 }
221 235
222 @end 236 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698