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 "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 10 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 [static_cast<BrowserWindowController*>(wc) | 170 [static_cast<BrowserWindowController*>(wc) |
171 lockBarVisibilityForOwner:self withAnimation:NO delay:NO]; | 171 lockBarVisibilityForOwner:self withAnimation:NO delay:NO]; |
172 } | 172 } |
173 | 173 |
174 // The new avatar bubble does not have an arrow, and it should be anchored | 174 // The new avatar bubble does not have an arrow, and it should be anchored |
175 // to the edge of the avatar button. | 175 // to the edge of the avatar button. |
176 int anchorX = switches::IsNewAvatarMenu() ? | 176 int anchorX = switches::IsNewAvatarMenu() ? |
177 NSMaxX([anchor bounds]) - kMenuXOffsetAdjust : | 177 NSMaxX([anchor bounds]) - kMenuXOffsetAdjust : |
178 NSMidX([anchor bounds]); | 178 NSMidX([anchor bounds]); |
179 NSPoint point = NSMakePoint(anchorX, | 179 NSPoint point = NSMakePoint(anchorX, |
180 NSMaxY([anchor bounds]) - kMenuYOffsetAdjust); | 180 NSMaxY([anchor bounds]) + kMenuYOffsetAdjust); |
181 point = [anchor convertPoint:point toView:nil]; | 181 point = [anchor convertPoint:point toView:nil]; |
182 point = [[anchor window] convertBaseToScreen:point]; | 182 point = [[anchor window] convertBaseToScreen:point]; |
183 | 183 |
184 // |menuController_| will automatically release itself on close. | 184 // |menuController_| will automatically release itself on close. |
185 if (switches::IsNewAvatarMenu()) { | 185 if (switches::IsNewAvatarMenu()) { |
186 profiles::BubbleViewMode viewMode; | 186 profiles::BubbleViewMode viewMode; |
187 profiles::TutorialMode tutorialMode; | 187 profiles::TutorialMode tutorialMode; |
188 profiles::BubbleViewModeFromAvatarBubbleMode( | 188 profiles::BubbleViewModeFromAvatarBubbleMode( |
189 mode, &viewMode, &tutorialMode); | 189 mode, &viewMode, &tutorialMode); |
190 menuController_ = | 190 menuController_ = |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 } | 236 } |
237 | 237 |
238 - (void)updateErrorStatus:(BOOL)hasError { | 238 - (void)updateErrorStatus:(BOOL)hasError { |
239 } | 239 } |
240 | 240 |
241 - (BaseBubbleController*)menuController { | 241 - (BaseBubbleController*)menuController { |
242 return menuController_; | 242 return menuController_; |
243 } | 243 } |
244 | 244 |
245 @end | 245 @end |
OLD | NEW |