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 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 return true; | 125 return true; |
126 } | 126 } |
127 | 127 |
128 bool SaveCardBubbleViews::Close() { | 128 bool SaveCardBubbleViews::Close() { |
129 // Cancel is logged as a different user action than closing, so override | 129 // Cancel is logged as a different user action than closing, so override |
130 // Close() to prevent the superclass' implementation from calling Cancel(). | 130 // Close() to prevent the superclass' implementation from calling Cancel(). |
131 // Return true to indicate that the bubble can be closed. | 131 // Return true to indicate that the bubble can be closed. |
132 return true; | 132 return true; |
133 } | 133 } |
134 | 134 |
135 int SaveCardBubbleViews::GetDialogButtons() const { | |
136 // This is the default for BubbleDialogDelegateView, but it's not the default | |
137 // for LocationBarBubbleDelegateView. | |
138 return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; | |
139 } | |
140 | |
141 base::string16 SaveCardBubbleViews::GetDialogButtonLabel( | 135 base::string16 SaveCardBubbleViews::GetDialogButtonLabel( |
142 ui::DialogButton button) const { | 136 ui::DialogButton button) const { |
143 return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK | 137 return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK |
144 ? IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT | 138 ? IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT |
145 : IDS_NO_THANKS); | 139 : IDS_NO_THANKS); |
146 } | 140 } |
147 | 141 |
148 bool SaveCardBubbleViews::ShouldDefaultButtonBeBlue() const { | 142 bool SaveCardBubbleViews::ShouldDefaultButtonBeBlue() const { |
149 return true; | 143 return true; |
150 } | 144 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 void SaveCardBubbleViews::Init() { | 280 void SaveCardBubbleViews::Init() { |
287 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); | 281 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); |
288 view_stack_ = new ViewStack(); | 282 view_stack_ = new ViewStack(); |
289 view_stack_->set_background(views::Background::CreateThemedSolidBackground( | 283 view_stack_->set_background(views::Background::CreateThemedSolidBackground( |
290 view_stack_, ui::NativeTheme::kColorId_BubbleBackground)); | 284 view_stack_, ui::NativeTheme::kColorId_BubbleBackground)); |
291 view_stack_->Push(CreateMainContentView(), /*animate=*/false); | 285 view_stack_->Push(CreateMainContentView(), /*animate=*/false); |
292 AddChildView(view_stack_); | 286 AddChildView(view_stack_); |
293 } | 287 } |
294 | 288 |
295 } // namespace autofill | 289 } // namespace autofill |
OLD | NEW |