| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/password_generation_popup_view_views.
h" | 5 #include "chrome/browser/ui/views/autofill/password_generation_popup_view_views.
h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "chrome/app/vector_icons/vector_icons.h" | 9 #include "chrome/app/vector_icons/vector_icons.h" |
| 10 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h" | 10 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 void Init(const base::string16& suggestion_text, | 44 void Init(const base::string16& suggestion_text, |
| 45 const base::string16& generated_password, | 45 const base::string16& generated_password, |
| 46 const gfx::FontList& font_list) { | 46 const gfx::FontList& font_list) { |
| 47 views::BoxLayout* box_layout = new views::BoxLayout( | 47 views::BoxLayout* box_layout = new views::BoxLayout( |
| 48 views::BoxLayout::kVertical, 0, 12, 5); | 48 views::BoxLayout::kVertical, 0, 12, 5); |
| 49 box_layout->set_main_axis_alignment( | 49 box_layout->set_main_axis_alignment( |
| 50 views::BoxLayout::MAIN_AXIS_ALIGNMENT_START); | 50 views::BoxLayout::MAIN_AXIS_ALIGNMENT_START); |
| 51 SetLayoutManager(box_layout); | 51 SetLayoutManager(box_layout); |
| 52 | 52 |
| 53 views::Label* suggestion_label = new views::Label( | 53 views::Label* suggestion_label = new views::Label( |
| 54 suggestion_text, {font_list.DeriveWithWeight(gfx::Font::Weight::BOLD)}); | 54 suggestion_text, views::Label::CustomFont{font_list.DeriveWithWeight( |
| 55 gfx::Font::Weight::BOLD)}); |
| 55 suggestion_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 56 suggestion_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 56 suggestion_label->SetEnabledColor( | 57 suggestion_label->SetEnabledColor( |
| 57 PasswordGenerationPopupView::kPasswordTextColor); | 58 PasswordGenerationPopupView::kPasswordTextColor); |
| 58 AddChildView(suggestion_label); | 59 AddChildView(suggestion_label); |
| 59 | 60 |
| 60 views::Label* password_label = | 61 views::Label* password_label = |
| 61 new views::Label(generated_password, {font_list}); | 62 new views::Label(generated_password, {font_list}); |
| 62 password_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 63 password_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 63 password_label->SetEnabledColor( | 64 password_label->SetEnabledColor( |
| 64 PasswordGenerationPopupView::kPasswordTextColor); | 65 PasswordGenerationPopupView::kPasswordTextColor); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 return new PasswordGenerationPopupViewViews(controller, observing_widget); | 284 return new PasswordGenerationPopupViewViews(controller, observing_widget); |
| 284 } | 285 } |
| 285 | 286 |
| 286 void PasswordGenerationPopupViewViews::GetAccessibleNodeData( | 287 void PasswordGenerationPopupViewViews::GetAccessibleNodeData( |
| 287 ui::AXNodeData* node_data) { | 288 ui::AXNodeData* node_data) { |
| 288 node_data->SetName(controller_->SuggestedText()); | 289 node_data->SetName(controller_->SuggestedText()); |
| 289 node_data->role = ui::AX_ROLE_MENU_ITEM; | 290 node_data->role = ui::AX_ROLE_MENU_ITEM; |
| 290 } | 291 } |
| 291 | 292 |
| 292 } // namespace autofill | 293 } // namespace autofill |
| OLD | NEW |