| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 212 } |
| 213 | 213 |
| 214 gfx::Rect PasswordGenerationBubbleView::GetAnchorRect() { | 214 gfx::Rect PasswordGenerationBubbleView::GetAnchorRect() { |
| 215 return anchor_rect_; | 215 return anchor_rect_; |
| 216 } | 216 } |
| 217 | 217 |
| 218 void PasswordGenerationBubbleView::ButtonPressed(views::Button* sender, | 218 void PasswordGenerationBubbleView::ButtonPressed(views::Button* sender, |
| 219 const ui::Event& event) { | 219 const ui::Event& event) { |
| 220 if (sender == accept_button_) { | 220 if (sender == accept_button_) { |
| 221 render_view_host_->Send(new AutofillMsg_GeneratedPasswordAccepted( | 221 render_view_host_->Send(new AutofillMsg_GeneratedPasswordAccepted( |
| 222 render_view_host_->GetRoutingID(), textfield_->text())); | 222 render_view_host_->GetRoutingID(), textfield_->GetText())); |
| 223 password_manager_->SetFormHasGeneratedPassword(form_); | 223 password_manager_->SetFormHasGeneratedPassword(form_); |
| 224 actions_.password_accepted = true; | 224 actions_.password_accepted = true; |
| 225 StartFade(false); | 225 StartFade(false); |
| 226 } | 226 } |
| 227 if (sender == regenerate_button_) { | 227 if (sender == regenerate_button_) { |
| 228 textfield_->SetText( | 228 textfield_->SetText( |
| 229 base::ASCIIToUTF16(password_generator_->Generate())); | 229 base::ASCIIToUTF16(password_generator_->Generate())); |
| 230 actions_.password_regenerated = true; | 230 actions_.password_regenerated = true; |
| 231 } | 231 } |
| 232 } | 232 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 243 return false; | 243 return false; |
| 244 } | 244 } |
| 245 | 245 |
| 246 views::View* PasswordGenerationBubbleView::GetInitiallyFocusedView() { | 246 views::View* PasswordGenerationBubbleView::GetInitiallyFocusedView() { |
| 247 return textfield_; | 247 return textfield_; |
| 248 } | 248 } |
| 249 | 249 |
| 250 void PasswordGenerationBubbleView::WindowClosing() { | 250 void PasswordGenerationBubbleView::WindowClosing() { |
| 251 autofill::password_generation::LogUserActions(actions_); | 251 autofill::password_generation::LogUserActions(actions_); |
| 252 } | 252 } |
| OLD | NEW |