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

Unified Diff: chrome/browser/extensions/component_loader.cc

Issue 47493005: Turn off enabling Google Now via flag in Stable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/component_loader.cc
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc
index b18ad9146d52752b189e1481fa1075446380a210..d8f0a840910c72136c9483a6f10c6a1557c3ab81 100644
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/chrome_version_info.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_file_util.h"
#include "chrome/common/pref_names.h"
@@ -514,14 +515,23 @@ void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages(
std::string enable_prefix(kEnablePrefix);
std::string field_trial_result =
base::FieldTrialList::FindFullName(kFieldTrialName);
- if (((field_trial_result.compare(
- 0,
- enable_prefix.length(),
- enable_prefix) == 0) &&
- !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableGoogleNowIntegration)) ||
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableGoogleNowIntegration)) {
+
+ bool enabled_via_field_trial = field_trial_result.compare(
+ 0,
+ enable_prefix.length(),
+ enable_prefix) == 0;
+
+ bool enabled_via_flag =
+ chrome::VersionInfo::GetChannel() !=
+ chrome::VersionInfo::CHANNEL_STABLE &&
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableGoogleNowIntegration);
+
+ bool disabled_via_flag =
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableGoogleNowIntegration);
+
+ if ((enabled_via_field_trial && !disabled_via_flag) || enabled_via_flag) {
Add(IDR_GOOGLE_NOW_MANIFEST,
base::FilePath(FILE_PATH_LITERAL("google_now")));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698