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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/autofill/password_generator.h" | 8 #include "chrome/browser/autofill/password_generator.h" |
9 #include "chrome/browser/password_manager/password_manager.h" | 9 #include "chrome/browser/password_manager/password_manager.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 layout->StartRow(0, 1); | 90 layout->StartRow(0, 1); |
91 layout->AddView(text_field_); | 91 layout->AddView(text_field_); |
92 layout->AddView(accept_button_); | 92 layout->AddView(accept_button_); |
93 } | 93 } |
94 | 94 |
95 gfx::Rect PasswordGenerationBubbleView::GetAnchorRect() { | 95 gfx::Rect PasswordGenerationBubbleView::GetAnchorRect() { |
96 return anchor_rect_; | 96 return anchor_rect_; |
97 } | 97 } |
98 | 98 |
99 void PasswordGenerationBubbleView::ButtonPressed(views::Button* sender, | 99 void PasswordGenerationBubbleView::ButtonPressed(views::Button* sender, |
100 const views::Event& event) { | 100 const ui::Event& event) { |
101 if (sender == accept_button_) { | 101 if (sender == accept_button_) { |
102 render_view_host_->Send(new AutofillMsg_GeneratedPasswordAccepted( | 102 render_view_host_->Send(new AutofillMsg_GeneratedPasswordAccepted( |
103 render_view_host_->GetRoutingID(), text_field_->text())); | 103 render_view_host_->GetRoutingID(), text_field_->text())); |
104 password_manager_->SetFormHasGeneratedPassword(form_); | 104 password_manager_->SetFormHasGeneratedPassword(form_); |
105 StartFade(false); | 105 StartFade(false); |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 void PasswordGenerationBubbleView::LinkClicked(views::Link* source, | 109 void PasswordGenerationBubbleView::LinkClicked(views::Link* source, |
110 int event_flags) { | 110 int event_flags) { |
111 content::OpenURLParams params( | 111 content::OpenURLParams params( |
112 GURL(chrome::kAutoPasswordGenerationLearnMoreURL), content::Referrer(), | 112 GURL(chrome::kAutoPasswordGenerationLearnMoreURL), content::Referrer(), |
113 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false); | 113 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false); |
114 navigator_->OpenURL(params); | 114 navigator_->OpenURL(params); |
115 StartFade(false); | 115 StartFade(false); |
116 } | 116 } |
117 | 117 |
118 views::View* PasswordGenerationBubbleView::GetInitiallyFocusedView() { | 118 views::View* PasswordGenerationBubbleView::GetInitiallyFocusedView() { |
119 return text_field_; | 119 return text_field_; |
120 } | 120 } |
OLD | NEW |