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

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

Issue 1764843003: Enable offline pages feature on trunk by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix 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
« no previous file with comments | « components/offline_pages/DEPS ('k') | components/offline_pages/offline_page_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "components/offline_pages/offline_page_switches.h" 13 #include "components/offline_pages/offline_page_switches.h"
14 #include "components/version_info/version_info.h"
14 15
15 #if defined(OS_ANDROID) 16 #if defined(OS_ANDROID)
16 17
17 namespace offline_pages { 18 namespace offline_pages {
18 19
19 namespace { 20 namespace {
20 const char kOfflinePagesFieldTrialName[] = "OfflinePages"; 21 const char kOfflinePagesFieldTrialName[] = "OfflinePages";
21 // The old experiment has only one mode to enable offline pages. 22 // The old experiment has only one mode to enable offline pages.
22 const char kEnabledGroupName[] = "Enabled"; 23 const char kEnabledGroupName[] = "Enabled";
23 // The new experiment supports two modes for offline pages. 24 // The new experiment supports two modes for offline pages.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return FeatureMode::ENABLED_AS_SAVED_PAGES; 56 return FeatureMode::ENABLED_AS_SAVED_PAGES;
56 // The new experiment can control showing either bookmark or saved page. 57 // The new experiment can control showing either bookmark or saved page.
57 if (base::StartsWith(group_name, kEnabledAsBookmarksGroupName, 58 if (base::StartsWith(group_name, kEnabledAsBookmarksGroupName,
58 base::CompareCase::SENSITIVE)) { 59 base::CompareCase::SENSITIVE)) {
59 return FeatureMode::ENABLED_AS_BOOKMARKS; 60 return FeatureMode::ENABLED_AS_BOOKMARKS;
60 } 61 }
61 if (base::StartsWith(group_name, kEnabledAsSavedPagesGroupName, 62 if (base::StartsWith(group_name, kEnabledAsSavedPagesGroupName,
62 base::CompareCase::SENSITIVE)) { 63 base::CompareCase::SENSITIVE)) {
63 return FeatureMode::ENABLED_AS_SAVED_PAGES; 64 return FeatureMode::ENABLED_AS_SAVED_PAGES;
64 } 65 }
65 return FeatureMode::DISABLED; 66
67 // Enabled by default on trunk.
68 return version_info::IsOfficialBuild() ? FeatureMode::DISABLED
69 : FeatureMode::ENABLED_AS_BOOKMARKS;
66 } 70 }
67 71
68 bool IsOfflinePagesEnabled() { 72 bool IsOfflinePagesEnabled() {
69 FeatureMode mode = GetOfflinePageFeatureMode(); 73 FeatureMode mode = GetOfflinePageFeatureMode();
70 return mode == FeatureMode::ENABLED_AS_BOOKMARKS || 74 return mode == FeatureMode::ENABLED_AS_BOOKMARKS ||
71 mode == FeatureMode::ENABLED_AS_SAVED_PAGES; 75 mode == FeatureMode::ENABLED_AS_SAVED_PAGES;
72 } 76 }
73 77
74 } // namespace offline_pages 78 } // namespace offline_pages
75 79
76 #endif 80 #endif
OLDNEW
« no previous file with comments | « components/offline_pages/DEPS ('k') | components/offline_pages/offline_page_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698