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

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, 7 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
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | chrome/test/functional/ntp.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
===================================================================
--- chrome/browser/ui/webui/ntp/app_launcher_handler.cc (revision 86287)
+++ 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;
@@ -103,6 +105,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) {
@@ -221,9 +225,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);
@@ -232,7 +237,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);
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | chrome/test/functional/ntp.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698