summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-10 06:31:22 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-10 06:31:22 +0000
commit5b092839306b23eb4c99284160690362e509a98a (patch)
treebbd7b30f2f07d628e6f78c655aa2b24d3992a96c /chrome/browser/dom_ui
parent656a716504ee028c7cfd6bda4d89d791003883d7 (diff)
downloadchromium_src-5b092839306b23eb4c99284160690362e509a98a.zip
chromium_src-5b092839306b23eb4c99284160690362e509a98a.tar.gz
chromium_src-5b092839306b23eb4c99284160690362e509a98a.tar.bz2
Add first cut at gallery integration.
Review URL: http://codereview.chromium.org/1989007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46810 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/app_launcher_handler.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc
index 3fc58fb..5fd206d 100644
--- a/chrome/browser/dom_ui/app_launcher_handler.cc
+++ b/chrome/browser/dom_ui/app_launcher_handler.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/url_constants.h"
@@ -82,18 +83,32 @@ void AppLauncherHandler::CreateAppInfo(Extension* extension,
}
void AppLauncherHandler::HandleGetApps(const Value* value) {
- ListValue list;
+ std::string gallery_title;
+ std::string gallery_url;
+
+ // TODO(aa): Decide the final values for these and remove the switches.
+ gallery_title = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kAppLauncherGalleryTitle);
+ gallery_url = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kAppLauncherGalleryURL);
+
+ DictionaryValue dictionary;
+ dictionary.SetString(L"galleryTitle", gallery_title);
+ dictionary.SetString(L"galleryURL", gallery_url);
+
+ ListValue* list = new ListValue();
const ExtensionList* extensions = extensions_service_->extensions();
for (ExtensionList::const_iterator it = extensions->begin();
it != extensions->end(); ++it) {
if (TreatAsApp(*it)) {
DictionaryValue* app_info = new DictionaryValue();
CreateAppInfo(*it, app_info);
- list.Append(app_info);
+ list->Append(app_info);
}
}
- dom_ui_->CallJavascriptFunction(L"getAppsCallback", list);
+ dictionary.Set(L"apps", list);
+ dom_ui_->CallJavascriptFunction(L"getAppsCallback", dictionary);
// First time we get here we set up the observer so that we can tell update
// the apps as they change.