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/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 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 IPC::Message* reply_message) | 1581 IPC::Message* reply_message) |
1582 : provider_(provider->AsWeakPtr()), | 1582 : provider_(provider->AsWeakPtr()), |
1583 reply_message_(reply_message) { | 1583 reply_message_(reply_message) { |
1584 } | 1584 } |
1585 | 1585 |
1586 AutomationProviderGetPasswordsObserver:: | 1586 AutomationProviderGetPasswordsObserver:: |
1587 ~AutomationProviderGetPasswordsObserver() {} | 1587 ~AutomationProviderGetPasswordsObserver() {} |
1588 | 1588 |
1589 void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone( | 1589 void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone( |
1590 CancelableRequestProvider::Handle handle, | 1590 CancelableRequestProvider::Handle handle, |
1591 const std::vector<webkit::forms::PasswordForm*>& result) { | 1591 const std::vector<content::PasswordForm*>& result) { |
1592 if (!provider_) { | 1592 if (!provider_) { |
1593 delete this; | 1593 delete this; |
1594 return; | 1594 return; |
1595 } | 1595 } |
1596 | 1596 |
1597 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); | 1597 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); |
1598 | 1598 |
1599 ListValue* passwords = new ListValue; | 1599 ListValue* passwords = new ListValue; |
1600 for (std::vector<webkit::forms::PasswordForm*>::const_iterator it = | 1600 for (std::vector<content::PasswordForm*>::const_iterator it = |
1601 result.begin(); it != result.end(); ++it) { | 1601 result.begin(); it != result.end(); ++it) { |
1602 DictionaryValue* password_val = new DictionaryValue; | 1602 DictionaryValue* password_val = new DictionaryValue; |
1603 webkit::forms::PasswordForm* password_form = *it; | 1603 content::PasswordForm* password_form = *it; |
1604 password_val->SetString("username_value", password_form->username_value); | 1604 password_val->SetString("username_value", password_form->username_value); |
1605 password_val->SetString("password_value", password_form->password_value); | 1605 password_val->SetString("password_value", password_form->password_value); |
1606 password_val->SetString("signon_realm", password_form->signon_realm); | 1606 password_val->SetString("signon_realm", password_form->signon_realm); |
1607 password_val->SetDouble( | 1607 password_val->SetDouble( |
1608 "time", static_cast<double>(password_form->date_created.ToDoubleT())); | 1608 "time", static_cast<double>(password_form->date_created.ToDoubleT())); |
1609 password_val->SetString("origin_url", password_form->origin.spec()); | 1609 password_val->SetString("origin_url", password_form->origin.spec()); |
1610 password_val->SetString("username_element", | 1610 password_val->SetString("username_element", |
1611 password_form->username_element); | 1611 password_form->username_element); |
1612 password_val->SetString("password_element", | 1612 password_val->SetString("password_element", |
1613 password_form->password_element); | 1613 password_form->password_element); |
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2878 if (automation_) { | 2878 if (automation_) { |
2879 AutomationJSONReply(automation_, reply_message_.release()) | 2879 AutomationJSONReply(automation_, reply_message_.release()) |
2880 .SendSuccess(NULL); | 2880 .SendSuccess(NULL); |
2881 } | 2881 } |
2882 delete this; | 2882 delete this; |
2883 } | 2883 } |
2884 } else { | 2884 } else { |
2885 NOTREACHED(); | 2885 NOTREACHED(); |
2886 } | 2886 } |
2887 } | 2887 } |
OLD | NEW |