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 #include "chrome/browser/ui/views/autofill/save_card_bubble_views.h" | 5 #include "chrome/browser/ui/views/autofill/save_card_bubble_views.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "chrome/browser/ui/browser_dialogs.h" |
11 #include "chrome/browser/ui/views/autofill/view_util.h" | 12 #include "chrome/browser/ui/views/autofill/view_util.h" |
12 #include "components/autofill/core/browser/credit_card.h" | 13 #include "components/autofill/core/browser/credit_card.h" |
13 #include "components/autofill/core/browser/legal_message_line.h" | 14 #include "components/autofill/core/browser/legal_message_line.h" |
14 #include "components/autofill/core/browser/ui/save_card_bubble_controller.h" | 15 #include "components/autofill/core/browser/ui/save_card_bubble_controller.h" |
15 #include "components/strings/grit/components_strings.h" | 16 #include "components/strings/grit/components_strings.h" |
16 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
17 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
18 #include "ui/views/border.h" | 19 #include "ui/views/border.h" |
19 #include "ui/views/bubble/bubble_frame_view.h" | 20 #include "ui/views/bubble/bubble_frame_view.h" |
20 #include "ui/views/controls/button/blue_button.h" | 21 #include "ui/views/controls/button/blue_button.h" |
(...skipping 29 matching lines...) Expand all Loading... |
50 | 51 |
51 SaveCardBubbleViews::SaveCardBubbleViews(views::View* anchor_view, | 52 SaveCardBubbleViews::SaveCardBubbleViews(views::View* anchor_view, |
52 content::WebContents* web_contents, | 53 content::WebContents* web_contents, |
53 SaveCardBubbleController* controller) | 54 SaveCardBubbleController* controller) |
54 : LocationBarBubbleDelegateView(anchor_view, web_contents), | 55 : LocationBarBubbleDelegateView(anchor_view, web_contents), |
55 controller_(controller), | 56 controller_(controller), |
56 cvc_textfield_(nullptr), | 57 cvc_textfield_(nullptr), |
57 learn_more_link_(nullptr) { | 58 learn_more_link_(nullptr) { |
58 DCHECK(controller); | 59 DCHECK(controller); |
59 views::BubbleDialogDelegateView::CreateBubble(this); | 60 views::BubbleDialogDelegateView::CreateBubble(this); |
| 61 chrome::RecordDialogCreation(chrome::DialogIdentifier::SAVE_CARD); |
60 } | 62 } |
61 | 63 |
62 SaveCardBubbleViews::~SaveCardBubbleViews() {} | 64 SaveCardBubbleViews::~SaveCardBubbleViews() {} |
63 | 65 |
64 void SaveCardBubbleViews::Show(DisplayReason reason) { | 66 void SaveCardBubbleViews::Show(DisplayReason reason) { |
65 ShowForReason(reason); | 67 ShowForReason(reason); |
66 } | 68 } |
67 | 69 |
68 void SaveCardBubbleViews::Hide() { | 70 void SaveCardBubbleViews::Hide() { |
69 controller_ = nullptr; | 71 controller_ = nullptr; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 DCHECK_EQ(cvc_textfield_, sender); | 258 DCHECK_EQ(cvc_textfield_, sender); |
257 GetDialogClientView()->UpdateDialogButtons(); | 259 GetDialogClientView()->UpdateDialogButtons(); |
258 } | 260 } |
259 | 261 |
260 void SaveCardBubbleViews::Init() { | 262 void SaveCardBubbleViews::Init() { |
261 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); | 263 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); |
262 AddChildView(CreateMainContentView().release()); | 264 AddChildView(CreateMainContentView().release()); |
263 } | 265 } |
264 | 266 |
265 } // namespace autofill | 267 } // namespace autofill |
OLD | NEW |