| 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 "chrome/common/net/gaia/gaia_urls.h" | 9 #include "chrome/common/net/gaia/gaia_urls.h" |
| 10 #include "chrome/common/password_generation_util.h" | 10 #include "chrome/common/password_generation_util.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 WebKit::WebCString PasswordGenerationManager::imageNameForDisabledState() { | 158 WebKit::WebCString PasswordGenerationManager::imageNameForDisabledState() { |
| 159 return imageNameForNormalState(); | 159 return imageNameForNormalState(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 WebKit::WebCString PasswordGenerationManager::imageNameForReadOnlyState() { | 162 WebKit::WebCString PasswordGenerationManager::imageNameForReadOnlyState() { |
| 163 return imageNameForNormalState(); | 163 return imageNameForNormalState(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void PasswordGenerationManager::handleClick(WebKit::WebInputElement& element) { | 166 void PasswordGenerationManager::handleClick(WebKit::WebInputElement& element) { |
| 167 gfx::Rect rect(element.decorationElementFor(this).boundsInViewportSpace()); | 167 gfx::Rect rect(element.decorationElementFor(this).boundsInViewportSpace()); |
| 168 webkit::forms::PasswordForm* password_form( | 168 scoped_ptr<webkit::forms::PasswordForm> password_form( |
| 169 webkit::forms::PasswordFormDomManager::CreatePasswordForm( | 169 webkit::forms::PasswordFormDomManager::CreatePasswordForm( |
| 170 element.form())); | 170 element.form())); |
| 171 if (password_form) { | 171 if (password_form.get()) { |
| 172 Send(new AutofillHostMsg_ShowPasswordGenerationPopup(routing_id(), | 172 Send(new AutofillHostMsg_ShowPasswordGenerationPopup(routing_id(), |
| 173 rect, | 173 rect, |
| 174 element.maxLength(), | 174 element.maxLength(), |
| 175 *password_form)); | 175 *password_form)); |
| 176 password_generation::LogPasswordGenerationEvent( | 176 password_generation::LogPasswordGenerationEvent( |
| 177 password_generation::BUBBLE_SHOWN); | 177 password_generation::BUBBLE_SHOWN); |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 void PasswordGenerationManager::willDetach( | 181 void PasswordGenerationManager::willDetach( |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 passwords_[0].decorationElementFor(this).setAttribute("style", | 235 passwords_[0].decorationElementFor(this).setAttribute("style", |
| 236 "display:block"); | 236 "display:block"); |
| 237 password_generation::LogPasswordGenerationEvent( | 237 password_generation::LogPasswordGenerationEvent( |
| 238 password_generation::ICON_SHOWN); | 238 password_generation::ICON_SHOWN); |
| 239 return; | 239 return; |
| 240 } | 240 } |
| 241 } | 241 } |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace autofill | 244 } // namespace autofill |
| OLD | NEW |