| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/password_generation_bubble_view.h" | 5 #include "chrome/browser/ui/views/password_generation_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/password_manager/password_manager.h" | 8 #include "chrome/browser/password_manager/password_manager.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 regenerate_button_->SetImage( | 161 regenerate_button_->SetImage( |
| 162 views::CustomButton::STATE_HOVERED, | 162 views::CustomButton::STATE_HOVERED, |
| 163 theme_provider_->GetImageSkiaNamed(IDR_RELOAD)); | 163 theme_provider_->GetImageSkiaNamed(IDR_RELOAD)); |
| 164 regenerate_button_->SetImage( | 164 regenerate_button_->SetImage( |
| 165 views::CustomButton::STATE_PRESSED, | 165 views::CustomButton::STATE_PRESSED, |
| 166 theme_provider_->GetImageSkiaNamed(IDR_RELOAD)); | 166 theme_provider_->GetImageSkiaNamed(IDR_RELOAD)); |
| 167 | 167 |
| 168 textfield_ = new views::Textfield(); | 168 textfield_ = new views::Textfield(); |
| 169 textfield_->set_default_width_in_chars(kDefaultTextFieldChars); | 169 textfield_->set_default_width_in_chars(kDefaultTextFieldChars); |
| 170 textfield_->SetText(base::ASCIIToUTF16(password_generator_->Generate())); | 170 textfield_->SetText(base::ASCIIToUTF16(password_generator_->Generate())); |
| 171 textfield_->SetController(this); | 171 textfield_->set_controller(this); |
| 172 | 172 |
| 173 textfield_wrapper_ = new TextfieldWrapper(textfield_, | 173 textfield_wrapper_ = new TextfieldWrapper(textfield_, |
| 174 regenerate_button_); | 174 regenerate_button_); |
| 175 AddChildView(textfield_wrapper_); | 175 AddChildView(textfield_wrapper_); |
| 176 | 176 |
| 177 accept_button_ = new views::LabelButton( | 177 accept_button_ = new views::LabelButton( |
| 178 this, | 178 this, |
| 179 l10n_util::GetStringUTF16(IDS_PASSWORD_GENERATION_BUTTON_TEXT)); | 179 l10n_util::GetStringUTF16(IDS_PASSWORD_GENERATION_BUTTON_TEXT)); |
| 180 accept_button_->SetStyle(views::Button::STYLE_BUTTON); | 180 accept_button_->SetStyle(views::Button::STYLE_BUTTON); |
| 181 AddChildView(accept_button_); | 181 AddChildView(accept_button_); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 return false; | 242 return false; |
| 243 } | 243 } |
| 244 | 244 |
| 245 views::View* PasswordGenerationBubbleView::GetInitiallyFocusedView() { | 245 views::View* PasswordGenerationBubbleView::GetInitiallyFocusedView() { |
| 246 return textfield_; | 246 return textfield_; |
| 247 } | 247 } |
| 248 | 248 |
| 249 void PasswordGenerationBubbleView::WindowClosing() { | 249 void PasswordGenerationBubbleView::WindowClosing() { |
| 250 autofill::password_generation::LogUserActions(actions_); | 250 autofill::password_generation::LogUserActions(actions_); |
| 251 } | 251 } |
| OLD | NEW |