| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 [profileChooserController initMenuContentsWithView:viewMode]; | 144 [profileChooserController initMenuContentsWithView:viewMode]; |
| 145 } | 145 } |
| 146 return; | 146 return; |
| 147 } | 147 } |
| 148 | 148 |
| 149 DCHECK(chrome::IsCommandEnabled(browser_, IDC_SHOW_AVATAR_MENU)); | 149 DCHECK(chrome::IsCommandEnabled(browser_, IDC_SHOW_AVATAR_MENU)); |
| 150 | 150 |
| 151 NSWindowController* wc = | 151 NSWindowController* wc = |
| 152 [browser_->window()->GetNativeWindow() windowController]; | 152 [browser_->window()->GetNativeWindow() windowController]; |
| 153 if ([wc isKindOfClass:[BrowserWindowController class]]) { | 153 if ([wc isKindOfClass:[BrowserWindowController class]]) { |
| 154 [static_cast<BrowserWindowController*>(wc) lockBarVisibilityForOwner:self | 154 [static_cast<BrowserWindowController*>(wc) |
| 155 withAnimation:NO]; | 155 lockToolbarVisibilityForOwner:self |
| 156 withAnimation:NO]; |
| 156 } | 157 } |
| 157 | 158 |
| 158 // The new avatar bubble does not have an arrow, and it should be anchored | 159 // The new avatar bubble does not have an arrow, and it should be anchored |
| 159 // to the edge of the avatar button. | 160 // to the edge of the avatar button. |
| 160 int anchorX = NSMaxX([anchor bounds]) - kMenuXOffsetAdjust; | 161 int anchorX = NSMaxX([anchor bounds]) - kMenuXOffsetAdjust; |
| 161 NSPoint point = NSMakePoint(anchorX, | 162 NSPoint point = NSMakePoint(anchorX, |
| 162 NSMaxY([anchor bounds]) + kMenuYOffsetAdjust); | 163 NSMaxY([anchor bounds]) + kMenuYOffsetAdjust); |
| 163 point = [anchor convertPoint:point toView:nil]; | 164 point = [anchor convertPoint:point toView:nil]; |
| 164 point = ui::ConvertPointFromWindowToScreen([anchor window], point); | 165 point = ui::ConvertPointFromWindowToScreen([anchor window], point); |
| 165 | 166 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 withServiceType:signin::GAIA_SERVICE_TYPE_NONE | 221 withServiceType:signin::GAIA_SERVICE_TYPE_NONE |
| 221 fromAccessPoint:signin_metrics::AccessPoint:: | 222 fromAccessPoint:signin_metrics::AccessPoint:: |
| 222 ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN]; | 223 ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN]; |
| 223 } | 224 } |
| 224 | 225 |
| 225 - (void)bubbleWillClose:(NSNotification*)notif { | 226 - (void)bubbleWillClose:(NSNotification*)notif { |
| 226 NSWindowController* wc = | 227 NSWindowController* wc = |
| 227 [browser_->window()->GetNativeWindow() windowController]; | 228 [browser_->window()->GetNativeWindow() windowController]; |
| 228 if ([wc isKindOfClass:[BrowserWindowController class]]) { | 229 if ([wc isKindOfClass:[BrowserWindowController class]]) { |
| 229 [static_cast<BrowserWindowController*>(wc) | 230 [static_cast<BrowserWindowController*>(wc) |
| 230 releaseBarVisibilityForOwner:self | 231 releaseToolbarVisibilityForOwner:self |
| 231 withAnimation:YES]; | 232 withAnimation:YES]; |
| 232 } | 233 } |
| 233 menuController_ = nil; | 234 menuController_ = nil; |
| 234 } | 235 } |
| 235 | 236 |
| 236 - (void)updateAvatarButtonAndLayoutParent:(BOOL)layoutParent { | 237 - (void)updateAvatarButtonAndLayoutParent:(BOOL)layoutParent { |
| 237 NOTREACHED(); | 238 NOTREACHED(); |
| 238 } | 239 } |
| 239 | 240 |
| 240 - (void)setErrorStatus:(BOOL)hasError { | 241 - (void)setErrorStatus:(BOOL)hasError { |
| 241 } | 242 } |
| 242 | 243 |
| 243 - (BaseBubbleController*)menuController { | 244 - (BaseBubbleController*)menuController { |
| 244 return menuController_; | 245 return menuController_; |
| 245 } | 246 } |
| 246 | 247 |
| 247 @end | 248 @end |
| OLD | NEW |