| 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" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 void SaveCardBubbleViews::Show(DisplayReason reason) { | 72 void SaveCardBubbleViews::Show(DisplayReason reason) { |
| 73 ShowForReason(reason); | 73 ShowForReason(reason); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void SaveCardBubbleViews::Hide() { | 76 void SaveCardBubbleViews::Hide() { |
| 77 controller_ = nullptr; | 77 controller_ = nullptr; |
| 78 Close(); | 78 Close(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 scoped_ptr<views::View> SaveCardBubbleViews::CreateFootnoteView() { | 81 views::View* SaveCardBubbleViews::CreateFootnoteView() { |
| 82 if (controller_->GetLegalMessageLines().empty()) | 82 if (controller_->GetLegalMessageLines().empty()) |
| 83 return nullptr; | 83 return nullptr; |
| 84 | 84 |
| 85 // Use BoxLayout to provide insets around the label. | 85 // Use BoxLayout to provide insets around the label. |
| 86 scoped_ptr<View> view(new View()); | 86 View* view = new View(); |
| 87 view->SetLayoutManager( | 87 view->SetLayoutManager( |
| 88 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); | 88 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); |
| 89 | 89 |
| 90 // Add a StyledLabel for each line of the legal message. | 90 // Add a StyledLabel for each line of the legal message. |
| 91 for (const LegalMessageLine& line : controller_->GetLegalMessageLines()) | 91 for (const LegalMessageLine& line : controller_->GetLegalMessageLines()) |
| 92 view->AddChildView(CreateLegalMessageLineLabel(line, this).release()); | 92 view->AddChildView(CreateLegalMessageLineLabel(line, this).release()); |
| 93 | 93 |
| 94 return view; | 94 return view; |
| 95 } | 95 } |
| 96 | 96 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 return view; | 222 return view; |
| 223 } | 223 } |
| 224 | 224 |
| 225 void SaveCardBubbleViews::Init() { | 225 void SaveCardBubbleViews::Init() { |
| 226 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); | 226 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); |
| 227 AddChildView(CreateMainContentView().release()); | 227 AddChildView(CreateMainContentView().release()); |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace autofill | 230 } // namespace autofill |
| OLD | NEW |