OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/automation/automation_provider_observers.h" | 5 #include "chrome/browser/automation/automation_provider_observers.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 IPC::Message* reply_message) | 1751 IPC::Message* reply_message) |
1752 : provider_(provider->AsWeakPtr()), | 1752 : provider_(provider->AsWeakPtr()), |
1753 reply_message_(reply_message) { | 1753 reply_message_(reply_message) { |
1754 } | 1754 } |
1755 | 1755 |
1756 AutomationProviderGetPasswordsObserver:: | 1756 AutomationProviderGetPasswordsObserver:: |
1757 ~AutomationProviderGetPasswordsObserver() {} | 1757 ~AutomationProviderGetPasswordsObserver() {} |
1758 | 1758 |
1759 void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone( | 1759 void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone( |
1760 CancelableRequestProvider::Handle handle, | 1760 CancelableRequestProvider::Handle handle, |
1761 const std::vector<webkit_glue::PasswordForm*>& result) { | 1761 const std::vector<webkit::forms::PasswordForm*>& result) { |
1762 if (!provider_) { | 1762 if (!provider_) { |
1763 delete this; | 1763 delete this; |
1764 return; | 1764 return; |
1765 } | 1765 } |
1766 | 1766 |
1767 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); | 1767 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); |
1768 | 1768 |
1769 ListValue* passwords = new ListValue; | 1769 ListValue* passwords = new ListValue; |
1770 for (std::vector<webkit_glue::PasswordForm*>::const_iterator it = | 1770 for (std::vector<webkit::forms::PasswordForm*>::const_iterator it = |
1771 result.begin(); it != result.end(); ++it) { | 1771 result.begin(); it != result.end(); ++it) { |
1772 DictionaryValue* password_val = new DictionaryValue; | 1772 DictionaryValue* password_val = new DictionaryValue; |
1773 webkit_glue::PasswordForm* password_form = *it; | 1773 webkit::forms::PasswordForm* password_form = *it; |
1774 password_val->SetString("username_value", password_form->username_value); | 1774 password_val->SetString("username_value", password_form->username_value); |
1775 password_val->SetString("password_value", password_form->password_value); | 1775 password_val->SetString("password_value", password_form->password_value); |
1776 password_val->SetString("signon_realm", password_form->signon_realm); | 1776 password_val->SetString("signon_realm", password_form->signon_realm); |
1777 password_val->SetDouble( | 1777 password_val->SetDouble( |
1778 "time", static_cast<double>(password_form->date_created.ToDoubleT())); | 1778 "time", static_cast<double>(password_form->date_created.ToDoubleT())); |
1779 password_val->SetString("origin_url", password_form->origin.spec()); | 1779 password_val->SetString("origin_url", password_form->origin.spec()); |
1780 password_val->SetString("username_element", | 1780 password_val->SetString("username_element", |
1781 password_form->username_element); | 1781 password_form->username_element); |
1782 password_val->SetString("password_element", | 1782 password_val->SetString("password_element", |
1783 password_form->password_element); | 1783 password_form->password_element); |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3095 } | 3095 } |
3096 | 3096 |
3097 ExtensionHost* host = content::Details<ExtensionHost>(details).ptr(); | 3097 ExtensionHost* host = content::Details<ExtensionHost>(details).ptr(); |
3098 if (host->extension_id() == extension_id_ && | 3098 if (host->extension_id() == extension_id_ && |
3099 host->extension_host_type() == chrome::VIEW_TYPE_EXTENSION_POPUP) { | 3099 host->extension_host_type() == chrome::VIEW_TYPE_EXTENSION_POPUP) { |
3100 AutomationJSONReply(automation_, reply_message_.release()) | 3100 AutomationJSONReply(automation_, reply_message_.release()) |
3101 .SendSuccess(NULL); | 3101 .SendSuccess(NULL); |
3102 delete this; | 3102 delete this; |
3103 } | 3103 } |
3104 } | 3104 } |
OLD | NEW |