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/app_launcher_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/app_launcher_handler.cc')
-rw-r--r-- | chrome/browser/dom_ui/app_launcher_handler.cc | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc index 8fd40e7..825be90 100644 --- a/chrome/browser/dom_ui/app_launcher_handler.cc +++ b/chrome/browser/dom_ui/app_launcher_handler.cc @@ -98,7 +98,7 @@ void AppLauncherHandler::CreateAppInfo(Extension* extension, value->SetString("icon", icon_url.spec()); } -void AppLauncherHandler::HandleGetApps(const Value* value) { +void AppLauncherHandler::HandleGetApps(const ListValue* args) { bool show_debug_link = CommandLine::ForCurrentProcess()->HasSwitch( switches::kAppsDebug); @@ -129,12 +129,7 @@ void AppLauncherHandler::HandleGetApps(const Value* value) { } } -void AppLauncherHandler::HandleLaunchApp(const Value* value) { - if (!value->IsType(Value::TYPE_LIST)) { - NOTREACHED(); - return; - } - +void AppLauncherHandler::HandleLaunchApp(const ListValue* args) { std::string extension_id; std::string launch_container; int left = 0; @@ -142,13 +137,12 @@ void AppLauncherHandler::HandleLaunchApp(const Value* value) { int width = 0; int height = 0; - const ListValue* list = static_cast<const ListValue*>(value); - if (!list->GetString(0, &extension_id) || - !list->GetString(1, &launch_container) || - !ExtractInt(list, 2, &left) || - !ExtractInt(list, 3, &top) || - !ExtractInt(list, 4, &width) || - !ExtractInt(list, 5, &height)) { + if (!args->GetString(0, &extension_id) || + !args->GetString(1, &launch_container) || + !ExtractInt(args, 2, &left) || + !ExtractInt(args, 3, &top) || + !ExtractInt(args, 4, &width) || + !ExtractInt(args, 5, &height)) { NOTREACHED(); return; } @@ -207,18 +201,8 @@ void AppLauncherHandler::AnimateAppIcon(Extension* extension, } } -void AppLauncherHandler::HandleUninstallApp(const Value* value) { - if (!value->IsType(Value::TYPE_LIST)) { - NOTREACHED(); - return; - } - - std::string extension_id; - const ListValue* list = static_cast<const ListValue*>(value); - if (!list->GetString(0, &extension_id)) { - NOTREACHED(); - return; - } +void AppLauncherHandler::HandleUninstallApp(const ListValue* args) { + std::string extension_id = WideToUTF8(ExtractStringValue(args)); // Make sure that the extension exists. Extension* extension = |