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

Unified Diff: chrome/common/extensions/extension.cc

Issue 10966018: Make Extension::ShouldDisplayInLauncher driven by manifest property. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/common/extensions/extension.h ('k') | chrome/common/extensions/extension_manifest_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 1b3e947a1b50a4fadc104b8175c0f88978ceaca4..af3892f75f7a69955d4604d4efcd1da93c2bc66c 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1050,7 +1050,11 @@ bool Extension::LoadAppFeatures(string16* error) {
!LoadLaunchContainer(error)) {
return false;
}
-
+ if (manifest_->HasKey(keys::kDisplayInLauncher) &&
+ !manifest_->GetBoolean(keys::kDisplayInLauncher, &display_in_launcher_)) {
+ *error = ASCIIToUTF16(errors::kInvalidDisplayInLauncher);
+ return false;
+ }
return true;
}
@@ -2949,6 +2953,7 @@ Extension::Extension(const FilePath& path,
launch_container_(extension_misc::LAUNCH_TAB),
launch_width_(0),
launch_height_(0),
+ display_in_launcher_(true),
wants_file_access_(false),
creation_flags_(0) {
DCHECK(path.empty() || path.IsAbsolute());
@@ -3811,18 +3816,8 @@ bool Extension::IsSyncable() const {
}
bool Extension::ShouldDisplayInLauncher() const {
- // All apps should be displayed on the NTP except for the Cloud Print App.
- bool should_display_in_launcher = is_app() &&
- id() != extension_misc::kCloudPrintAppId;
-#if defined(OS_CHROMEOS)
- // Wallpaper manager is a component app which can only be launched via context
- // menu or set wallpaper button in chrome settings page. We want to hide it
- // from launcher.
- return should_display_in_launcher &&
- id() != extension_misc::kWallpaperManagerId;
-#else
- return should_display_in_launcher;
-#endif
+ // Only apps should be displayed on the NTP.
+ return is_app() && display_in_launcher_;
}
bool Extension::InstallWarning::operator==(const InstallWarning& other) const {
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_manifest_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698