diff options
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/chrome_switches.cc | 8 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/common/extensions/extension.cc | 14 | ||||
-rw-r--r-- | chrome/common/extensions/extension.h | 4 |
4 files changed, 16 insertions, 11 deletions
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 64da0bd..fece52f 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -103,14 +103,6 @@ const char kDisableAltWinstation[] = "disable-winsta"; // Disable the ApplicationCache. const char kDisableApplicationCache[] = "disable-application-cache"; -// Disables the app launcher popup when a new tab is created, directly creates -// a tab instead. Takes precedence over kAppLauncherForNewTab. -// TODO(jcivelli): http://crbug.com/44089 this flag is required for some tests -// to work, as showing the app launcher is the default on -// ChromeOS but not on other platforms. Tests should be fixed -// once it becomes the default behavior on all platforms. -const char kDisableAppsPanel[] = "disable-apps-panel"; - // Replaces the audio IPC layer for <audio> and <video> with a mock audio // device, useful when using remote desktop or machines without sound cards. // This is temporary until we fix the underlying problem. diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 26a94f9..71b6afb 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -45,7 +45,6 @@ extern const char kDebugPrint[]; extern const char kDiagnostics[]; extern const char kDisableAltWinstation[]; extern const char kDisableApplicationCache[]; -extern const char kDisableAppsPanel[]; extern const char kDisableAudio[]; extern const char kDisableAuthNegotiateCnameLookup[]; extern const char kDisableBackingStoreLimit[]; diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 956017c..89d7095 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -724,8 +724,7 @@ Extension::Extension(const FilePath& path) being_upgraded_(false) { DCHECK(path.IsAbsolute()); - apps_enabled_ = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableApps); + apps_enabled_ = AppsAreEnabled(); location_ = INVALID; #if defined(OS_WIN) @@ -930,6 +929,17 @@ GURL Extension::GetBaseURLFromExtensionId(const std::string& extension_id) { chrome::kStandardSchemeSeparator + extension_id + "/"); } +// static +bool Extension::AppsAreEnabled() { +#if defined(OS_CHROMEOS) + return true; +#else + static bool apps_enabled_mode = + CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps); + return apps_enabled_mode; +#endif +} + bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, std::string* error) { if (source.HasKey(keys::kPublicKey)) { diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 9063b12..a135df5 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -209,6 +209,10 @@ class Extension { // Returns the base extension url for a given |extension_id|. static GURL GetBaseURLFromExtensionId(const std::string& extension_id); + // Returns whether the browser has apps enabled (either as the default or if + // it was explictly turned on via a command line switch). + static bool AppsAreEnabled(); + // Initialize the extension from a parsed manifest. // Usually, the id of an extension is generated by the "key" property of // its manifest, but if |require_key| is |false|, a temporary ID will be |