| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/cocoa/autofill/new_credit_card_bubble_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/autofill/new_credit_card_bubble_cocoa.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "chrome/browser/ui/autofill/new_credit_card_bubble_controller.h" | 10 #include "chrome/browser/ui/autofill/new_credit_card_bubble_controller.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 if (!bubbleController_) | 206 if (!bubbleController_) |
| 207 CreateCocoaController(parent_window); | 207 CreateCocoaController(parent_window); |
| 208 | 208 |
| 209 NSPoint anchor_point; | 209 NSPoint anchor_point; |
| 210 NSView* anchor_view; | 210 NSView* anchor_view; |
| 211 if ([bwc isTabbedWindow]) { | 211 if ([bwc isTabbedWindow]) { |
| 212 anchor_view = [[bwc toolbarController] wrenchButton]; | 212 anchor_view = [[bwc toolbarController] wrenchButton]; |
| 213 anchor_point = NSMakePoint( | 213 anchor_point = NSMakePoint( |
| 214 NSMidX([anchor_view bounds]), | 214 NSMidX([anchor_view bounds]), |
| 215 NSMinY([anchor_view bounds]) + kWrenchBubblePointOffsetY); | 215 NSMinY([anchor_view bounds]) + kWrenchBubblePointOffsetY); |
| 216 [[bubbleController_ bubble] setArrowLocation:info_bubble::kTopRight]; | 216 [[bubbleController_ bubble] |
| 217 setArrowLocation:views::BubbleBorder::TOP_RIGHT]; |
| 217 [[bubbleController_ bubble] setAlignment:info_bubble::kAlignArrowToAnchor]; | 218 [[bubbleController_ bubble] setAlignment:info_bubble::kAlignArrowToAnchor]; |
| 218 } else { | 219 } else { |
| 219 anchor_view = browser_view; | 220 anchor_view = browser_view; |
| 220 anchor_point = NSMakePoint( | 221 anchor_point = NSMakePoint( |
| 221 NSMaxX([browser_view bounds]) - kAnchorlessEndPadding, | 222 NSMaxX([browser_view bounds]) - kAnchorlessEndPadding, |
| 222 NSMaxY([browser_view bounds]) - kAnchorlessTopPadding); | 223 NSMaxY([browser_view bounds]) - kAnchorlessTopPadding); |
| 223 [[bubbleController_ bubble] setArrowLocation:info_bubble::kNoArrow]; | 224 [[bubbleController_ bubble] setArrowLocation:views::BubbleBorder::NONE]; |
| 224 if (base::i18n::IsRTL()) { | 225 if (base::i18n::IsRTL()) { |
| 225 anchor_point.x = NSMaxX([anchor_view bounds]) - anchor_point.x; | 226 anchor_point.x = NSMaxX([anchor_view bounds]) - anchor_point.x; |
| 226 [[bubbleController_ bubble] setAlignment: | 227 [[bubbleController_ bubble] setAlignment: |
| 227 info_bubble::kAlignLeftEdgeToAnchorEdge]; | 228 info_bubble::kAlignLeftEdgeToAnchorEdge]; |
| 228 } else { | 229 } else { |
| 229 [[bubbleController_ bubble] setAlignment: | 230 [[bubbleController_ bubble] setAlignment: |
| 230 info_bubble::kAlignRightEdgeToAnchorEdge]; | 231 info_bubble::kAlignRightEdgeToAnchorEdge]; |
| 231 } | 232 } |
| 232 } | 233 } |
| 233 if ([anchor_view isFlipped]) | 234 if ([anchor_view isFlipped]) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 controller:controller_ | 266 controller:controller_ |
| 266 bridge:this]; | 267 bridge:this]; |
| 267 } | 268 } |
| 268 | 269 |
| 269 InfoBubbleWindow* NewCreditCardBubbleCocoa::GetInfoBubbleWindow() { | 270 InfoBubbleWindow* NewCreditCardBubbleCocoa::GetInfoBubbleWindow() { |
| 270 return base::mac::ObjCCastStrict<InfoBubbleWindow>( | 271 return base::mac::ObjCCastStrict<InfoBubbleWindow>( |
| 271 [bubbleController_ window]); | 272 [bubbleController_ window]); |
| 272 } | 273 } |
| 273 | 274 |
| 274 } // namespace autofill | 275 } // namespace autofill |
| OLD | NEW |