Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Side by Side Diff: chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc

Issue 2734113006: "Bootstrap" a toolkit-views Typography spec. (Closed)
Patch Set: Rebase (conflict in layout_delegate.h due to r457774) Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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, {font_list.DeriveWithWeight(gfx::Font::Weight::BOLD)});
55 suggestion_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 55 suggestion_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
56 suggestion_label->SetEnabledColor( 56 suggestion_label->SetEnabledColor(
57 PasswordGenerationPopupView::kPasswordTextColor); 57 PasswordGenerationPopupView::kPasswordTextColor);
58 AddChildView(suggestion_label); 58 AddChildView(suggestion_label);
59 59
60 views::Label* password_label = 60 views::Label* password_label =
61 new views::Label(generated_password, font_list); 61 new views::Label(generated_password, {font_list});
62 password_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 62 password_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
63 password_label->SetEnabledColor( 63 password_label->SetEnabledColor(
64 PasswordGenerationPopupView::kPasswordTextColor); 64 PasswordGenerationPopupView::kPasswordTextColor);
65 AddChildView(password_label); 65 AddChildView(password_label);
66 } 66 }
67 67
68 // views::View: 68 // views::View:
69 bool CanProcessEventsWithinSubtree() const override { 69 bool CanProcessEventsWithinSubtree() const override {
70 // Send events to the parent view for handling. 70 // Send events to the parent view for handling.
71 return false; 71 return false;
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 return new PasswordGenerationPopupViewViews(controller, observing_widget); 283 return new PasswordGenerationPopupViewViews(controller, observing_widget);
284 } 284 }
285 285
286 void PasswordGenerationPopupViewViews::GetAccessibleNodeData( 286 void PasswordGenerationPopupViewViews::GetAccessibleNodeData(
287 ui::AXNodeData* node_data) { 287 ui::AXNodeData* node_data) {
288 node_data->SetName(controller_->SuggestedText()); 288 node_data->SetName(controller_->SuggestedText());
289 node_data->role = ui::AX_ROLE_MENU_ITEM; 289 node_data->role = ui::AX_ROLE_MENU_ITEM;
290 } 290 }
291 291
292 } // namespace autofill 292 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698