| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  152   NSWindowController* wc = |  152   NSWindowController* wc = | 
|  153       [browser_->window()->GetNativeWindow() windowController]; |  153       [browser_->window()->GetNativeWindow() windowController]; | 
|  154   if ([wc isKindOfClass:[BrowserWindowController class]]) { |  154   if ([wc isKindOfClass:[BrowserWindowController class]]) { | 
|  155     [static_cast<BrowserWindowController*>(wc) |  155     [static_cast<BrowserWindowController*>(wc) | 
|  156         lockToolbarVisibilityForOwner:self |  156         lockToolbarVisibilityForOwner:self | 
|  157                         withAnimation:NO]; |  157                         withAnimation:NO]; | 
|  158   } |  158   } | 
|  159  |  159  | 
|  160   // The new avatar bubble does not have an arrow, and it should be anchored |  160   // The new avatar bubble does not have an arrow, and it should be anchored | 
|  161   // to the edge of the avatar button. |  161   // to the edge of the avatar button. | 
|  162   int anchorX = cocoa_l10n_util::ShouldDoExperimentalRTLLayout() |  162   int anchorX = cocoa_l10n_util::ShouldFlipWindowControlsInRTL() | 
|  163                     ? NSMinX([anchor bounds]) + kMenuXOffsetAdjust |  163                     ? NSMinX([anchor bounds]) + kMenuXOffsetAdjust | 
|  164                     : NSMaxX([anchor bounds]) - kMenuXOffsetAdjust; |  164                     : NSMaxX([anchor bounds]) - kMenuXOffsetAdjust; | 
|  165   NSPoint point = NSMakePoint(anchorX, |  165   NSPoint point = NSMakePoint(anchorX, | 
|  166                               NSMaxY([anchor bounds]) + kMenuYOffsetAdjust); |  166                               NSMaxY([anchor bounds]) + kMenuYOffsetAdjust); | 
|  167   point = [anchor convertPoint:point toView:nil]; |  167   point = [anchor convertPoint:point toView:nil]; | 
|  168   point = ui::ConvertPointFromWindowToScreen([anchor window], point); |  168   point = ui::ConvertPointFromWindowToScreen([anchor window], point); | 
|  169  |  169  | 
|  170   // |menuController_| will automatically release itself on close. |  170   // |menuController_| will automatically release itself on close. | 
|  171   profiles::BubbleViewMode viewMode; |  171   profiles::BubbleViewMode viewMode; | 
|  172   profiles::TutorialMode tutorialMode; |  172   profiles::TutorialMode tutorialMode; | 
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  242 } |  242 } | 
|  243  |  243  | 
|  244 - (void)setErrorStatus:(BOOL)hasError { |  244 - (void)setErrorStatus:(BOOL)hasError { | 
|  245 } |  245 } | 
|  246  |  246  | 
|  247 - (BaseBubbleController*)menuController { |  247 - (BaseBubbleController*)menuController { | 
|  248   return menuController_; |  248   return menuController_; | 
|  249 } |  249 } | 
|  250  |  250  | 
|  251 @end |  251 @end | 
| OLD | NEW |