| 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 "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 rect)); | 84 rect)); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool PasswordGenerationManager::OnMessageReceived(const IPC::Message& message) { | 88 bool PasswordGenerationManager::OnMessageReceived(const IPC::Message& message) { |
| 89 bool handled = true; | 89 bool handled = true; |
| 90 IPC_BEGIN_MESSAGE_MAP(PasswordGenerationManager, message) | 90 IPC_BEGIN_MESSAGE_MAP(PasswordGenerationManager, message) |
| 91 IPC_MESSAGE_HANDLER(AutofillMsg_GeneratedPasswordAccepted, | 91 IPC_MESSAGE_HANDLER(AutofillMsg_GeneratedPasswordAccepted, |
| 92 OnPasswordAccepted) | 92 OnPasswordAccepted) |
| 93 IPC_MESSAGE_HANDLER(AutofillMsg_PasswordGenerationEnabled, | 93 IPC_MESSAGE_HANDLER(AutofillMsg_PasswordGenerationEnabled, |
| 94 OnPasswordSyncEnabled) | 94 OnPasswordGenerationEnabled) |
| 95 IPC_MESSAGE_UNHANDLED(handled = false) | 95 IPC_MESSAGE_UNHANDLED(handled = false) |
| 96 IPC_END_MESSAGE_MAP() | 96 IPC_END_MESSAGE_MAP() |
| 97 return handled; | 97 return handled; |
| 98 } | 98 } |
| 99 | 99 |
| 100 void PasswordGenerationManager::OnPasswordAccepted(const string16& password) { | 100 void PasswordGenerationManager::OnPasswordAccepted(const string16& password) { |
| 101 for (std::vector<WebKit::WebInputElement>::iterator it = | 101 for (std::vector<WebKit::WebInputElement>::iterator it = |
| 102 account_creation_elements_.second.begin(); | 102 account_creation_elements_.second.begin(); |
| 103 it != account_creation_elements_.second.end(); ++it) { | 103 it != account_creation_elements_.second.end(); ++it) { |
| 104 it->setValue(password); | 104 it->setValue(password); |
| 105 it->setAutofilled(true); | 105 it->setAutofilled(true); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 void PasswordGenerationManager::OnPasswordSyncEnabled(bool enabled) { | 109 void PasswordGenerationManager::OnPasswordGenerationEnabled(bool enabled) { |
| 110 enabled_ = enabled; | 110 enabled_ = enabled; |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace autofill | 113 } // namespace autofill |
| OLD | NEW |