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