Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1227)

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 6912024: Support for component extensions as apps on the new tab page. Added filebrowser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
===================================================================
--- chrome/browser/ui/webui/ntp/app_launcher_handler.cc (revision 83882)
+++ chrome/browser/ui/webui/ntp/app_launcher_handler.cc (working copy)
@@ -47,6 +47,8 @@
const char* kPingLaunchWebStore = "record-webstore-launch";
const char* kPingLaunchAppByURL = "record-app-launch-by-url";
+const char* kChromeWebStoreUrl = "https://chrome.google.com/webstore";
+
const UnescapeRule::Type kUnescapeRules =
UnescapeRule::NORMAL | UnescapeRule::URL_SPECIAL_CHARS;
@@ -101,6 +103,8 @@
value->SetInteger("launch_type",
prefs->GetLaunchType(extension->id(),
ExtensionPrefs::LAUNCH_DEFAULT));
+ value->SetBoolean("is_component",
+ extension->location() == Extension::COMPONENT);
int app_launch_index = prefs->GetAppLaunchIndex(extension->id());
if (app_launch_index == -1) {
@@ -219,9 +223,10 @@
const ExtensionList* extensions = extensions_service_->extensions();
ExtensionList::const_iterator it;
for (it = extensions->begin(); it != extensions->end(); ++it) {
- // Don't include the WebStore and other component apps.
+ // Don't include the WebStore.
// The WebStore launcher gets special treatment in ntp/apps.js.
- if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT) {
+ if ((*it)->is_app() &&
+ (*it)->GetFullLaunchURL().spec() != kChromeWebStoreUrl) {
DictionaryValue* app_info = new DictionaryValue();
CreateAppInfo(*it, extensions_service_->extension_prefs(), app_info);
list->Append(app_info);
@@ -230,7 +235,8 @@
extensions = extensions_service_->disabled_extensions();
for (it = extensions->begin(); it != extensions->end(); ++it) {
- if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT) {
+ if ((*it)->is_app() &&
+ (*it)->GetFullLaunchURL().spec() != kChromeWebStoreUrl) {
DictionaryValue* app_info = new DictionaryValue();
CreateAppInfo(*it, extensions_service_->extension_prefs(), app_info);
list->Append(app_info);

Powered by Google App Engine
This is Rietveld 408576698