| 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/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 bool IsEnhancedBookmarksExperimentEnabled() { | 167 bool IsEnhancedBookmarksExperimentEnabled() { |
| 168 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 168 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 169 if (command_line->HasSwitch(switches::kManualEnhancedBookmarks) || | 169 if (command_line->HasSwitch(switches::kManualEnhancedBookmarks) || |
| 170 command_line->HasSwitch(switches::kManualEnhancedBookmarksOptout)) { | 170 command_line->HasSwitch(switches::kManualEnhancedBookmarksOptout)) { |
| 171 return true; | 171 return true; |
| 172 } | 172 } |
| 173 | 173 |
| 174 return IsEnhancedBookmarksExperimentEnabledFromFinch(); | 174 return IsEnhancedBookmarksExperimentEnabledFromFinch(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 #if defined(OS_ANDROID) |
| 178 bool IsEnhancedBookmarkImageFetchingEnabled() { |
| 179 if (IsEnhancedBookmarksExperimentEnabled()) |
| 180 return true; |
| 181 |
| 182 // Salient images are collected from visited bookmarked pages even if the |
| 183 // enhanced bookmark feature is turned off. This is to have some images |
| 184 // available so that in the future, when the feature is turned on, the user |
| 185 // experience is not a big list of flat colors. However as a precautionary |
| 186 // measure it is possible to disable this collection of images from finch. |
| 187 std::string disable_fetching = chrome_variations::GetVariationParamValue( |
| 188 kFieldTrialName, "DisableImagesFetching"); |
| 189 return disable_fetching.empty(); |
| 190 } |
| 191 #endif |
| 192 |
| 177 bool IsEnableDomDistillerSet() { | 193 bool IsEnableDomDistillerSet() { |
| 178 if (CommandLine::ForCurrentProcess()-> | 194 if (CommandLine::ForCurrentProcess()-> |
| 179 HasSwitch(switches::kEnableDomDistiller)) { | 195 HasSwitch(switches::kEnableDomDistiller)) { |
| 180 return true; | 196 return true; |
| 181 } | 197 } |
| 182 if (chrome_variations::GetVariationParamValue( | 198 if (chrome_variations::GetVariationParamValue( |
| 183 kFieldTrialName, "enable-dom-distiller") == "1") | 199 kFieldTrialName, "enable-dom-distiller") == "1") |
| 184 return true; | 200 return true; |
| 185 | 201 |
| 186 return false; | 202 return false; |
| 187 } | 203 } |
| 188 | 204 |
| 189 bool IsEnableSyncArticlesSet() { | 205 bool IsEnableSyncArticlesSet() { |
| 190 if (CommandLine::ForCurrentProcess()-> | 206 if (CommandLine::ForCurrentProcess()-> |
| 191 HasSwitch(switches::kEnableSyncArticles)) { | 207 HasSwitch(switches::kEnableSyncArticles)) { |
| 192 return true; | 208 return true; |
| 193 } | 209 } |
| 194 if (chrome_variations::GetVariationParamValue( | 210 if (chrome_variations::GetVariationParamValue( |
| 195 kFieldTrialName, "enable-sync-articles") == "1") | 211 kFieldTrialName, "enable-sync-articles") == "1") |
| 196 return true; | 212 return true; |
| 197 | 213 |
| 198 return false; | 214 return false; |
| 199 } | 215 } |
| OLD | NEW |