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/renderer/autofill/password_generation_manager.h" | 5 #include "chrome/renderer/autofill/password_generation_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/common/autofill_messages.h" | 8 #include "chrome/common/autofill_messages.h" |
9 #include "content/public/renderer/render_view.h" | 9 #include "content/public/renderer/render_view.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 105 } |
106 | 106 |
107 void PasswordGenerationManager::handleClick(WebKit::WebInputElement& element) { | 107 void PasswordGenerationManager::handleClick(WebKit::WebInputElement& element) { |
108 gfx::Rect rect(element.decorationElementFor(this).boundsInViewportSpace()); | 108 gfx::Rect rect(element.decorationElementFor(this).boundsInViewportSpace()); |
109 webkit::forms::PasswordForm* password_form( | 109 webkit::forms::PasswordForm* password_form( |
110 webkit::forms::PasswordFormDomManager::CreatePasswordForm( | 110 webkit::forms::PasswordFormDomManager::CreatePasswordForm( |
111 element.form())); | 111 element.form())); |
112 if (password_form) { | 112 if (password_form) { |
113 Send(new AutofillHostMsg_ShowPasswordGenerationPopup(routing_id(), | 113 Send(new AutofillHostMsg_ShowPasswordGenerationPopup(routing_id(), |
114 rect, | 114 rect, |
| 115 element.maxLength(), |
115 *password_form)); | 116 *password_form)); |
116 } | 117 } |
117 } | 118 } |
118 | 119 |
119 void PasswordGenerationManager::willDetach( | 120 void PasswordGenerationManager::willDetach( |
120 const WebKit::WebInputElement& element) { | 121 const WebKit::WebInputElement& element) { |
121 // No implementation | 122 // No implementation |
122 } | 123 } |
123 | 124 |
124 bool PasswordGenerationManager::OnMessageReceived(const IPC::Message& message) { | 125 bool PasswordGenerationManager::OnMessageReceived(const IPC::Message& message) { |
(...skipping 14 matching lines...) Expand all Loading... |
139 it->setValue(password); | 140 it->setValue(password); |
140 it->setAutofilled(true); | 141 it->setAutofilled(true); |
141 } | 142 } |
142 } | 143 } |
143 | 144 |
144 void PasswordGenerationManager::OnPasswordGenerationEnabled(bool enabled) { | 145 void PasswordGenerationManager::OnPasswordGenerationEnabled(bool enabled) { |
145 enabled_ = enabled; | 146 enabled_ = enabled; |
146 } | 147 } |
147 | 148 |
148 } // namespace autofill | 149 } // namespace autofill |
OLD | NEW |