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/generated_credit_card_bubble_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/autofill/generated_credit_card_bubble_cocoa.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" | 10 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 backing:NSBackingStoreBuffered | 64 backing:NSBackingStoreBuffered |
65 defer:NO]); | 65 defer:NO]); |
66 if ((self = [super initWithWindow:window | 66 if ((self = [super initWithWindow:window |
67 parentWindow:parentWindow | 67 parentWindow:parentWindow |
68 anchoredAt:NSZeroPoint])) { | 68 anchoredAt:NSZeroPoint])) { |
69 [window setInfoBubbleCanBecomeKeyWindow:NO]; | 69 [window setInfoBubbleCanBecomeKeyWindow:NO]; |
70 bridge_.reset(bridge); | 70 bridge_.reset(bridge); |
71 | 71 |
72 ui::NativeTheme* nativeTheme = ui::NativeTheme::instance(); | 72 ui::NativeTheme* nativeTheme = ui::NativeTheme::instance(); |
73 [[self bubble] setAlignment:info_bubble::kAlignArrowToAnchor]; | 73 [[self bubble] setAlignment:info_bubble::kAlignArrowToAnchor]; |
74 [[self bubble] setArrowLocation:info_bubble::kTopRight]; | 74 [[self bubble] setArrowLocation:views::BubbleBorder::TOP_RIGHT]; |
75 [[self bubble] setBackgroundColor: | 75 [[self bubble] setBackgroundColor: |
76 gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( | 76 gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( |
77 ui::NativeTheme::kColorId_DialogBackground))]; | 77 ui::NativeTheme::kColorId_DialogBackground))]; |
78 [self performLayoutWithController:bridge->controller().get()]; | 78 [self performLayoutWithController:bridge->controller().get()]; |
79 } | 79 } |
80 return self; | 80 return self; |
81 } | 81 } |
82 | 82 |
83 - (void)windowWillClose:(NSNotification*)notification { | 83 - (void)windowWillClose:(NSNotification*)notification { |
84 bridge_->OnBubbleClosing(); | 84 bridge_->OnBubbleClosing(); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 void GeneratedCreditCardBubbleCocoa::OnBubbleClosing() { | 236 void GeneratedCreditCardBubbleCocoa::OnBubbleClosing() { |
237 bubbleController_ = nil; | 237 bubbleController_ = nil; |
238 } | 238 } |
239 | 239 |
240 void GeneratedCreditCardBubbleCocoa::OnLinkClicked() { | 240 void GeneratedCreditCardBubbleCocoa::OnLinkClicked() { |
241 if (controller_) | 241 if (controller_) |
242 controller_->OnLinkClicked(); | 242 controller_->OnLinkClicked(); |
243 } | 243 } |
244 | 244 |
245 } // autofill | 245 } // autofill |
OLD | NEW |