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

Unified Diff: chrome/browser/about_flags.cc

Issue 68173031: Added enhanced bookmarks extension as an external component extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index c89bb6d6678fdf2bcc92e977bf187162023a5a19..dec942b76ffb37d0f96b9fe5cce38c827dc4b660 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -17,6 +17,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "cc/base/switches.h"
+#include "chrome/browser/extensions/external_component_loader.h"
#include "chrome/browser/flags_storage.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_switches.h"
@@ -1831,6 +1832,14 @@ const Experiment kExperiments[] = {
kOsDesktop,
SINGLE_VALUE_TYPE(switches::kEnableAppsShowOnFirstPaint)
},
+ {
+ "enable-enhanced-bookmarks",
+ IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
+ IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
+ kOsDesktop,
+ ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kEnableEnhancedBookmarks, "1",
+ switches::kEnableEnhancedBookmarks, "0")
+ },
};
const Experiment* experiments = kExperiments;
@@ -1933,6 +1942,15 @@ void GetSanitizedEnabledFlags(
*result = flags_storage->GetFlags();
}
+bool SkipConditionalExperiment(const Experiment& experiment) {
+ if (experiment.internal_name == std::string("enable-enhanced-bookmarks")) {
+ return !extensions::ExternalComponentLoader::
+ IsEnhancedBookmarksExperimentEnabled();
+ }
+ return false;
+}
+
+
// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
// enabled on the current platform.
void GetSanitizedEnabledFlagsForCurrentPlatform(
@@ -2040,6 +2058,8 @@ void GetFlagsExperimentsData(FlagsStorage* flags_storage,
for (size_t i = 0; i < num_experiments; ++i) {
const Experiment& experiment = experiments[i];
+ if (SkipConditionalExperiment(experiment))
+ continue;
DictionaryValue* data = new DictionaryValue();
data->SetString("internal_name", experiment.internal_name);

Powered by Google App Engine
This is Rietveld 408576698