OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/website_settings/chooser_bubble_ui_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 return ui::ConvertPointFromWindowToScreen([self getExpectedParentWindow], | 240 return ui::ConvertPointFromWindowToScreen([self getExpectedParentWindow], |
241 anchor); | 241 anchor); |
242 } | 242 } |
243 | 243 |
244 - (bool)hasLocationBar { | 244 - (bool)hasLocationBar { |
245 return browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR); | 245 return browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR); |
246 } | 246 } |
247 | 247 |
248 - (info_bubble::BubbleArrowLocation)getExpectedArrowLocation { | 248 - (info_bubble::BubbleArrowLocation)getExpectedArrowLocation { |
249 return [self hasLocationBar] ? info_bubble::kTopLeft : info_bubble::kNoArrow; | 249 return [self hasLocationBar] ? info_bubble::kTopLeading |
| 250 : info_bubble::kNoArrow; |
250 } | 251 } |
251 | 252 |
252 - (NSWindow*)getExpectedParentWindow { | 253 - (NSWindow*)getExpectedParentWindow { |
253 DCHECK(browser_->window()); | 254 DCHECK(browser_->window()); |
254 return browser_->window()->GetNativeWindow(); | 255 return browser_->window()->GetNativeWindow(); |
255 } | 256 } |
256 | 257 |
257 + (CGFloat)matchWidthsOf:(NSView*)viewA andOf:(NSView*)viewB { | 258 + (CGFloat)matchWidthsOf:(NSView*)viewA andOf:(NSView*)viewB { |
258 NSRect frameA = [viewA frame]; | 259 NSRect frameA = [viewA frame]; |
259 NSRect frameB = [viewB frame]; | 260 NSRect frameB = [viewB frame]; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 324 } |
324 | 325 |
325 void ChooserBubbleUiCocoa::UpdateAnchorPosition() { | 326 void ChooserBubbleUiCocoa::UpdateAnchorPosition() { |
326 if (chooser_bubble_ui_controller_) | 327 if (chooser_bubble_ui_controller_) |
327 [chooser_bubble_ui_controller_ updateAnchorPosition]; | 328 [chooser_bubble_ui_controller_ updateAnchorPosition]; |
328 } | 329 } |
329 | 330 |
330 void ChooserBubbleUiCocoa::OnBubbleClosing() { | 331 void ChooserBubbleUiCocoa::OnBubbleClosing() { |
331 chooser_bubble_ui_controller_ = nil; | 332 chooser_bubble_ui_controller_ = nil; |
332 } | 333 } |
OLD | NEW |