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

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

Issue 360213002: Add Flex to views::BoxLayout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 6 years, 5 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 | Annotate | Revision Log
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/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h" 8 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/views/background.h" 10 #include "ui/views/background.h"
(...skipping 16 matching lines...) Expand all
27 public: 27 public:
28 PasswordRow(const base::string16& password, 28 PasswordRow(const base::string16& password,
29 const base::string16& suggestion, 29 const base::string16& suggestion,
30 const gfx::FontList& font_list, 30 const gfx::FontList& font_list,
31 int horizontal_border) { 31 int horizontal_border) {
32 set_clip_insets(gfx::Insets( 32 set_clip_insets(gfx::Insets(
33 PasswordGenerationPopupView::kPasswordVerticalInset, 0, 33 PasswordGenerationPopupView::kPasswordVerticalInset, 0,
34 PasswordGenerationPopupView::kPasswordVerticalInset, 0)); 34 PasswordGenerationPopupView::kPasswordVerticalInset, 0));
35 views::BoxLayout* box_layout = new views::BoxLayout( 35 views::BoxLayout* box_layout = new views::BoxLayout(
36 views::BoxLayout::kHorizontal, horizontal_border, 0, 0); 36 views::BoxLayout::kHorizontal, horizontal_border, 0, 0);
37 box_layout->set_main_axis_alignment( 37 box_layout->set_default_flex(1);
38 views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL);
39 SetLayoutManager(box_layout); 38 SetLayoutManager(box_layout);
40 39
41 password_label_ = new views::Label(password, font_list); 40 password_label_ = new views::Label(password, font_list);
42 password_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 41 password_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
43 AddChildView(password_label_); 42 AddChildView(password_label_);
44 43
45 suggestion_label_ = new views::Label(suggestion, font_list); 44 suggestion_label_ = new views::Label(suggestion, font_list);
46 suggestion_label_->SetHorizontalAlignment(gfx::ALIGN_RIGHT); 45 suggestion_label_->SetHorizontalAlignment(gfx::ALIGN_RIGHT);
47 suggestion_label_->SetEnabledColor( 46 suggestion_label_->SetEnabledColor(
48 PasswordGenerationPopupView::kExplanatoryTextColor); 47 PasswordGenerationPopupView::kExplanatoryTextColor);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 177
179 // If the top level widget can't be found, cancel the popup since we can't 178 // If the top level widget can't be found, cancel the popup since we can't
180 // fully set it up. 179 // fully set it up.
181 if (!observing_widget) 180 if (!observing_widget)
182 return NULL; 181 return NULL;
183 182
184 return new PasswordGenerationPopupViewViews(controller, observing_widget); 183 return new PasswordGenerationPopupViewViews(controller, observing_widget);
185 } 184 }
186 185
187 } // namespace autofill 186 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698