| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |