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

Side by Side Diff: chrome/browser/bookmarks/enhanced_bookmarks_features.cc

Issue 293943002: Clean up TestFeaturesNativeHandler to use the ExtensionsClient's JSON feature sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" 5 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/prefs/scoped_user_pref_update.h" 9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "base/sha1.h" 10 #include "base/sha1.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 bool IsEnhancedBookmarksExperimentEnabled() { 49 bool IsEnhancedBookmarksExperimentEnabled() {
50 CommandLine* command_line = CommandLine::ForCurrentProcess(); 50 CommandLine* command_line = CommandLine::ForCurrentProcess();
51 if (command_line->HasSwitch(switches::kManualEnhancedBookmarks) || 51 if (command_line->HasSwitch(switches::kManualEnhancedBookmarks) ||
52 command_line->HasSwitch(switches::kManualEnhancedBookmarksOptout)) { 52 command_line->HasSwitch(switches::kManualEnhancedBookmarksOptout)) {
53 return true; 53 return true;
54 } 54 }
55 55
56 std::string ext_id = GetEnhancedBookmarksExtensionIdFromFinch(); 56 std::string ext_id = GetEnhancedBookmarksExtensionIdFromFinch();
57 extensions::FeatureProvider* feature_provider = 57 const extensions::FeatureProvider* feature_provider =
58 extensions::FeatureProvider::GetPermissionFeatures(); 58 extensions::FeatureProvider::GetPermissionFeatures();
59 extensions::Feature* feature = feature_provider->GetFeature("metricsPrivate"); 59 extensions::Feature* feature = feature_provider->GetFeature("metricsPrivate");
60 return feature && feature->IsIdInWhitelist(ext_id); 60 return feature && feature->IsIdInWhitelist(ext_id);
61 } 61 }
62 62
63 bool IsEnableDomDistillerSet() { 63 bool IsEnableDomDistillerSet() {
64 if (CommandLine::ForCurrentProcess()-> 64 if (CommandLine::ForCurrentProcess()->
65 HasSwitch(switches::kEnableDomDistiller)) { 65 HasSwitch(switches::kEnableDomDistiller)) {
66 return true; 66 return true;
67 } 67 }
(...skipping 12 matching lines...) Expand all
80 if (chrome_variations::GetVariationParamValue( 80 if (chrome_variations::GetVariationParamValue(
81 kFieldTrialName, "enable-sync-articles") == "1") 81 kFieldTrialName, "enable-sync-articles") == "1")
82 return true; 82 return true;
83 83
84 return false; 84 return false;
85 } 85 }
86 86
87 std::string GetEnhancedBookmarksExtensionIdFromFinch() { 87 std::string GetEnhancedBookmarksExtensionIdFromFinch() {
88 return chrome_variations::GetVariationParamValue(kFieldTrialName, "id"); 88 return chrome_variations::GetVariationParamValue(kFieldTrialName, "id");
89 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698