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

Side by Side Diff: components/offline_pages/offline_page_feature.cc

Issue 1750883002: Add enable-offlining-recent-pages feature switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated histogram.xml Created 4 years, 9 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/offline_pages/offline_page_feature.h" 5 #include "components/offline_pages/offline_page_feature.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 return FeatureMode::DISABLED; 65 return FeatureMode::DISABLED;
66 } 66 }
67 67
68 bool IsOfflinePagesEnabled() { 68 bool IsOfflinePagesEnabled() {
69 FeatureMode mode = GetOfflinePageFeatureMode(); 69 FeatureMode mode = GetOfflinePageFeatureMode();
70 return mode == FeatureMode::ENABLED_AS_BOOKMARKS || 70 return mode == FeatureMode::ENABLED_AS_BOOKMARKS ||
71 mode == FeatureMode::ENABLED_AS_SAVED_PAGES; 71 mode == FeatureMode::ENABLED_AS_SAVED_PAGES;
72 } 72 }
73 73
74 bool IsOffliningRecentPagesEnabled() {
75 bool hasDisableSwitch = base::CommandLine::ForCurrentProcess()->HasSwitch(
jianli 2016/03/02 00:52:31 nit: C++ style
76 switches::kDisableOffliningRecentPages);
77 bool hasEnableSwitch = base::CommandLine::ForCurrentProcess()->HasSwitch(
78 switches::kEnableOffliningRecentPages);
79
80 // Default is 'disable'.
81 return !hasDisableSwitch && hasEnableSwitch && IsOfflinePagesEnabled();
82 }
83
84
74 } // namespace offline_pages 85 } // namespace offline_pages
75 86
76 #endif 87 #endif
OLDNEW
« no previous file with comments | « components/offline_pages/offline_page_feature.h ('k') | components/offline_pages/offline_page_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698