| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 NOTREACHED(); | 188 NOTREACHED(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Create view containing everything except for the footnote. | 191 // Create view containing everything except for the footnote. |
| 192 std::unique_ptr<views::View> SaveCardBubbleViews::CreateMainContentView() { | 192 std::unique_ptr<views::View> SaveCardBubbleViews::CreateMainContentView() { |
| 193 auto view = base::MakeUnique<views::View>(); | 193 auto view = base::MakeUnique<views::View>(); |
| 194 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); | 194 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); |
| 195 | 195 |
| 196 view->SetLayoutManager(new views::BoxLayout( | 196 view->SetLayoutManager(new views::BoxLayout( |
| 197 views::BoxLayout::kVertical, gfx::Insets(), | 197 views::BoxLayout::kVertical, gfx::Insets(), |
| 198 provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL))); | 198 provider->GetDistanceMetric(views::DISTANCE_UNRELATED_CONTROL_VERTICAL))); |
| 199 | 199 |
| 200 // Add the card type icon, last four digits and expiration date. | 200 // Add the card type icon, last four digits and expiration date. |
| 201 views::View* description_view = new views::View(); | 201 views::View* description_view = new views::View(); |
| 202 description_view->SetLayoutManager(new views::BoxLayout( | 202 description_view->SetLayoutManager(new views::BoxLayout( |
| 203 views::BoxLayout::kHorizontal, gfx::Insets(), | 203 views::BoxLayout::kHorizontal, gfx::Insets(), |
| 204 provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL))); | 204 provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL))); |
| 205 view->AddChildView(description_view); | 205 view->AddChildView(description_view); |
| 206 | 206 |
| 207 const CreditCard& card = controller_->GetCard(); | 207 const CreditCard& card = controller_->GetCard(); |
| 208 views::ImageView* card_type_icon = new views::ImageView(); | 208 views::ImageView* card_type_icon = new views::ImageView(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 void SaveCardBubbleViews::Init() { | 279 void SaveCardBubbleViews::Init() { |
| 280 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical)); | 280 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical)); |
| 281 view_stack_ = new ViewStack(); | 281 view_stack_ = new ViewStack(); |
| 282 view_stack_->SetBackground(views::CreateThemedSolidBackground( | 282 view_stack_->SetBackground(views::CreateThemedSolidBackground( |
| 283 view_stack_, ui::NativeTheme::kColorId_BubbleBackground)); | 283 view_stack_, ui::NativeTheme::kColorId_BubbleBackground)); |
| 284 view_stack_->Push(CreateMainContentView(), /*animate=*/false); | 284 view_stack_->Push(CreateMainContentView(), /*animate=*/false); |
| 285 AddChildView(view_stack_); | 285 AddChildView(view_stack_); |
| 286 } | 286 } |
| 287 | 287 |
| 288 } // namespace autofill | 288 } // namespace autofill |
| OLD | NEW |