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/views/autofill/new_credit_card_bubble_views.h" | 5 #include "chrome/browser/ui/views/autofill/new_credit_card_bubble_views.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "chrome/browser/ui/autofill/new_credit_card_bubble_controller.h" | 8 #include "chrome/browser/ui/autofill/new_credit_card_bubble_controller.h" |
9 #include "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
10 #include "chrome/browser/ui/host_desktop.h" | 10 #include "chrome/browser/ui/host_desktop.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // This bubble doesn't render correctly on Windows without calling | 57 // This bubble doesn't render correctly on Windows without calling |
58 // |SizeToContents()|. This must be called after showing the widget. | 58 // |SizeToContents()|. This must be called after showing the widget. |
59 SizeToContents(); | 59 SizeToContents(); |
60 } | 60 } |
61 | 61 |
62 void NewCreditCardBubbleViews::Hide() { | 62 void NewCreditCardBubbleViews::Hide() { |
63 GetWidget()->Close(); | 63 GetWidget()->Close(); |
64 } | 64 } |
65 | 65 |
66 gfx::Size NewCreditCardBubbleViews::GetPreferredSize() { | 66 gfx::Size NewCreditCardBubbleViews::GetPreferredSize() const { |
67 return gfx::Size( | 67 return gfx::Size( |
68 NewCreditCardBubbleView::kContentsWidth, | 68 NewCreditCardBubbleView::kContentsWidth, |
69 GetHeightForWidth(NewCreditCardBubbleView::kContentsWidth)); | 69 GetHeightForWidth(NewCreditCardBubbleView::kContentsWidth)); |
70 } | 70 } |
71 | 71 |
72 void NewCreditCardBubbleViews::Init() { | 72 void NewCreditCardBubbleViews::Init() { |
73 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, | 73 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, |
74 views::kRelatedControlVerticalSpacing)); | 74 views::kRelatedControlVerticalSpacing)); |
75 | 75 |
76 views::View* card_container = new views::View(); | 76 views::View* card_container = new views::View(); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 NewCreditCardBubbleViews::NewCreditCardBubbleViews( | 152 NewCreditCardBubbleViews::NewCreditCardBubbleViews( |
153 NewCreditCardBubbleController* controller) | 153 NewCreditCardBubbleController* controller) |
154 : BubbleDelegateView(GetAnchor(controller), GetArrow(controller)), | 154 : BubbleDelegateView(GetAnchor(controller), GetArrow(controller)), |
155 controller_(controller), | 155 controller_(controller), |
156 weak_ptr_factory_(this) { | 156 weak_ptr_factory_(this) { |
157 gfx::Insets insets = views::BubbleFrameView::GetTitleInsets(); | 157 gfx::Insets insets = views::BubbleFrameView::GetTitleInsets(); |
158 set_margins(gfx::Insets(0, insets.left(), insets.top(), insets.left())); | 158 set_margins(gfx::Insets(0, insets.left(), insets.top(), insets.left())); |
159 } | 159 } |
160 | 160 |
161 } // namespace autofill | 161 } // namespace autofill |
OLD | NEW |