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

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

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 years, 6 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/browser/ui/autofill/password_generation_popup_controller.h" 9 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h"
10 #include "chrome/browser/ui/autofill/popup_constants.h" 10 #include "chrome/browser/ui/autofill/popup_constants.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 void Init(const base::string16& suggestion_text, 43 void Init(const base::string16& suggestion_text,
44 const base::string16& generated_password, 44 const base::string16& generated_password,
45 const gfx::FontList& font_list) { 45 const gfx::FontList& font_list) {
46 views::BoxLayout* box_layout = new views::BoxLayout( 46 views::BoxLayout* box_layout = new views::BoxLayout(
47 views::BoxLayout::kVertical, 0, 12, 5); 47 views::BoxLayout::kVertical, 0, 12, 5);
48 box_layout->set_main_axis_alignment( 48 box_layout->set_main_axis_alignment(
49 views::BoxLayout::MAIN_AXIS_ALIGNMENT_START); 49 views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
50 SetLayoutManager(box_layout); 50 SetLayoutManager(box_layout);
51 51
52 views::Label* suggestion_label = new views::Label( 52 views::Label* suggestion_label = new views::Label(
53 suggestion_text, font_list.DeriveWithStyle(gfx::Font::BOLD)); 53 suggestion_text, font_list.DeriveWithWeight(gfx::Font::Weight::BOLD));
54 suggestion_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 54 suggestion_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
55 suggestion_label->SetEnabledColor( 55 suggestion_label->SetEnabledColor(
56 PasswordGenerationPopupView::kPasswordTextColor); 56 PasswordGenerationPopupView::kPasswordTextColor);
57 AddChildView(suggestion_label); 57 AddChildView(suggestion_label);
58 58
59 views::Label* password_label = 59 views::Label* password_label =
60 new views::Label(generated_password, font_list); 60 new views::Label(generated_password, font_list);
61 password_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 61 password_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
62 password_label->SetEnabledColor( 62 password_label->SetEnabledColor(
63 PasswordGenerationPopupView::kPasswordTextColor); 63 PasswordGenerationPopupView::kPasswordTextColor);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 return new PasswordGenerationPopupViewViews(controller, observing_widget); 279 return new PasswordGenerationPopupViewViews(controller, observing_widget);
280 } 280 }
281 281
282 void PasswordGenerationPopupViewViews::GetAccessibleState( 282 void PasswordGenerationPopupViewViews::GetAccessibleState(
283 ui::AXViewState* state) { 283 ui::AXViewState* state) {
284 state->name = controller_->SuggestedText(); 284 state->name = controller_->SuggestedText();
285 state->role = ui::AX_ROLE_MENU_ITEM; 285 state->role = ui::AX_ROLE_MENU_ITEM;
286 } 286 }
287 287
288 } // namespace autofill 288 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698