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/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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 help_label_->SetDefaultStyle(default_style); | 137 help_label_->SetDefaultStyle(default_style); |
138 | 138 |
139 views::StyledLabel::RangeStyleInfo link_style = | 139 views::StyledLabel::RangeStyleInfo link_style = |
140 views::StyledLabel::RangeStyleInfo::CreateForLink(); | 140 views::StyledLabel::RangeStyleInfo::CreateForLink(); |
141 link_style.disable_line_wrapping = false; | 141 link_style.disable_line_wrapping = false; |
142 help_label_->AddStyleRange(controller_->HelpTextLinkRange(), link_style); | 142 help_label_->AddStyleRange(controller_->HelpTextLinkRange(), link_style); |
143 | 143 |
144 help_label_->set_background( | 144 help_label_->set_background( |
145 views::Background::CreateSolidBackground( | 145 views::Background::CreateSolidBackground( |
146 kExplanatoryTextBackgroundColor)); | 146 kExplanatoryTextBackgroundColor)); |
147 help_label_->SetBorder(views::Border::CreateEmptyBorder( | 147 help_label_->SetBorder(views::CreateEmptyBorder( |
148 PasswordGenerationPopupController::kHelpVerticalPadding - | 148 PasswordGenerationPopupController::kHelpVerticalPadding - |
149 kHelpVerticalOffset, | 149 kHelpVerticalOffset, |
150 PasswordGenerationPopupController::kHorizontalPadding, | 150 PasswordGenerationPopupController::kHorizontalPadding, |
151 PasswordGenerationPopupController::kHelpVerticalPadding - | 151 PasswordGenerationPopupController::kHelpVerticalPadding - |
152 kHelpVerticalOffset, | 152 kHelpVerticalOffset, |
153 PasswordGenerationPopupController::kHorizontalPadding)); | 153 PasswordGenerationPopupController::kHorizontalPadding)); |
154 AddChildView(help_label_); | 154 AddChildView(help_label_); |
155 | 155 |
156 set_background(views::Background::CreateSolidBackground(kPopupBackground)); | 156 set_background(views::Background::CreateSolidBackground(kPopupBackground)); |
157 } | 157 } |
158 | 158 |
159 PasswordGenerationPopupViewViews::~PasswordGenerationPopupViewViews() {} | 159 PasswordGenerationPopupViewViews::~PasswordGenerationPopupViewViews() {} |
160 | 160 |
161 void PasswordGenerationPopupViewViews::CreatePasswordView() { | 161 void PasswordGenerationPopupViewViews::CreatePasswordView() { |
162 if (password_view_) | 162 if (password_view_) |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 return new PasswordGenerationPopupViewViews(controller, observing_widget); | 279 return new PasswordGenerationPopupViewViews(controller, observing_widget); |
280 } | 280 } |
281 | 281 |
282 void PasswordGenerationPopupViewViews::GetAccessibleNodeData( | 282 void PasswordGenerationPopupViewViews::GetAccessibleNodeData( |
283 ui::AXNodeData* node_data) { | 283 ui::AXNodeData* node_data) { |
284 node_data->SetName(controller_->SuggestedText()); | 284 node_data->SetName(controller_->SuggestedText()); |
285 node_data->role = ui::AX_ROLE_MENU_ITEM; | 285 node_data->role = ui::AX_ROLE_MENU_ITEM; |
286 } | 286 } |
287 | 287 |
288 } // namespace autofill | 288 } // namespace autofill |
OLD | NEW |