diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 20:34:43 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 20:34:43 +0000 |
commit | 88942a2dab7da11dc89b4fe95151fdefa6cef036 (patch) | |
tree | 3047b9779e5b8b8a9a04c26e83ebc478e825f4b5 /chrome/browser/dom_ui/passwords_exceptions_handler.cc | |
parent | 2acaa4de809c66b8b826e3bf93930e2b3bf4c65f (diff) | |
download | chromium_src-88942a2dab7da11dc89b4fe95151fdefa6cef036.zip chromium_src-88942a2dab7da11dc89b4fe95151fdefa6cef036.tar.gz chromium_src-88942a2dab7da11dc89b4fe95151fdefa6cef036.tar.bz2 |
DOM UI: Change DOMMessageHandler callback arg type to ListValue.
The parameter describes a list of Values that act as parameters to the callback. It is always a ListValue. It should be typed as such.
BUG=none
TEST=compile; manual testing
Review URL: http://codereview.chromium.org/3146019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/passwords_exceptions_handler.cc')
-rw-r--r-- | chrome/browser/dom_ui/passwords_exceptions_handler.cc | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/chrome/browser/dom_ui/passwords_exceptions_handler.cc b/chrome/browser/dom_ui/passwords_exceptions_handler.cc index c41bf10..44888bf 100644 --- a/chrome/browser/dom_ui/passwords_exceptions_handler.cc +++ b/chrome/browser/dom_ui/passwords_exceptions_handler.cc @@ -75,48 +75,23 @@ PasswordStore* PasswordsExceptionsHandler::GetPasswordStore() { return profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS); } -void PasswordsExceptionsHandler::LoadSavedPasswords(const Value* value) { +void PasswordsExceptionsHandler::LoadSavedPasswords(const ListValue* args) { populater_.Populate(); } -void PasswordsExceptionsHandler::RemoveEntry(const Value* value) { - if (!value || !value->IsType(Value::TYPE_LIST)) { - NOTREACHED(); - return; - } - - const ListValue* param_values = static_cast<const ListValue*>(value); - std::string string_value; - if (param_values->GetSize() != 1 || - !param_values->GetString(0, &string_value)) { - NOTREACHED(); - return; - } - int selected_index; - base::StringToInt(string_value, &selected_index); +void PasswordsExceptionsHandler::RemoveEntry(const ListValue* args) { + int index; + CHECK(ExtractIntegerValue(args, &index)); - GetPasswordStore()->RemoveLogin(*password_list_[selected_index]); - delete password_list_[selected_index]; - password_list_.erase(password_list_.begin() + selected_index); + GetPasswordStore()->RemoveLogin(*password_list_[index]); + delete password_list_[index]; + password_list_.erase(password_list_.begin() + index); SetPasswordList(); } -void PasswordsExceptionsHandler::ShowSelectedPassword(const Value* value) { - if (!value || !value->IsType(Value::TYPE_LIST)) { - NOTREACHED(); - return; - } - - const ListValue* param_values = static_cast<const ListValue*>(value); - std::string string_value; - if (param_values->GetSize() != 1 || - !param_values->GetString(0, &string_value)) { - NOTREACHED(); - return; - } - +void PasswordsExceptionsHandler::ShowSelectedPassword(const ListValue* args) { int index; - base::StringToInt(string_value, &index); + CHECK(ExtractIntegerValue(args, &index)); std::string pass = UTF16ToUTF8(password_list_[index]->password_value); scoped_ptr<Value> password_string(Value::CreateStringValue(pass)); |