Commit 06e983db authored by olivierrobin's avatar olivierrobin Committed by Commit bot

Reland of Enable RL by default

Reland of https://codereview.chromium.org/2562643003/ after fixing the
issue.

BUG=577659

Review-Url: https://codereview.chromium.org/2573473002
Cr-Commit-Position: refs/heads/master@{#438100}
parent 9b985851
...@@ -2,12 +2,22 @@ ...@@ -2,12 +2,22 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//components/reading_list/core/reading_list.gni")
source_set("core") { source_set("core") {
sources = [ sources = [
"reading_list_switches.cc", "reading_list_switches.cc",
"reading_list_switches.h", "reading_list_switches.h",
] ]
deps = [ deps = [
":reading_list_enable_flags",
"//base", "//base",
] ]
} }
buildflag_header("reading_list_enable_flags") {
header = "reading_list_enable_flags.h"
_enabled = is_ios && enable_reading_list
flags = [ "ENABLE_READING_LIST=$_enabled" ]
}
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
declare_args() {
# Controls whether reading list support is active or not. Currently only
# supported on iOS (on other platforms, the feature is always disabled).
enable_reading_list = true
}
...@@ -6,23 +6,12 @@ ...@@ -6,23 +6,12 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "components/reading_list/core/reading_list_enable_flags.h"
namespace reading_list { namespace reading_list {
namespace switches { namespace switches {
// Enables the reading list.
const char kEnableReadingList[] = "enable-reading-list";
// Disables the reading list.
const char kDisableReadingList[] = "disable-reading-list";
bool IsReadingListEnabled() { bool IsReadingListEnabled() {
// Reading list is only enabled on iOS. return BUILDFLAG(ENABLE_READING_LIST);
#if defined(OS_IOS)
if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableReadingList)) {
return true;
}
#endif
return false;
} }
} // namespace switches } // namespace switches
} // namespace reading_list } // namespace reading_list
...@@ -7,9 +7,6 @@ ...@@ -7,9 +7,6 @@
namespace reading_list { namespace reading_list {
namespace switches { namespace switches {
extern const char kEnableReadingList[];
extern const char kDisableReadingList[];
// Whether Reading List is enabled on this device. // Whether Reading List is enabled on this device.
bool IsReadingListEnabled(); bool IsReadingListEnabled();
} // namespace switches } // namespace switches
......
...@@ -234,13 +234,6 @@ void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) { ...@@ -234,13 +234,6 @@ void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
command_line->AppendSwitch(switches::kDisablePaymentRequest); command_line->AppendSwitch(switches::kDisablePaymentRequest);
} }
// Populate command line flags from Reading List.
if ([defaults boolForKey:@"EnableReadingList"]) {
command_line->AppendSwitch(reading_list::switches::kEnableReadingList);
} else {
command_line->AppendSwitch(reading_list::switches::kDisableReadingList);
}
// Populate command line flag for Spotlight Actions. // Populate command line flag for Spotlight Actions.
if ([defaults boolForKey:@"DisableSpotlightActions"]) { if ([defaults boolForKey:@"DisableSpotlightActions"]) {
command_line->AppendSwitch(switches::kDisableSpotlightActions); command_line->AppendSwitch(switches::kDisableSpotlightActions);
......
...@@ -112,6 +112,7 @@ source_set("unit_tests") { ...@@ -112,6 +112,7 @@ source_set("unit_tests") {
":sync", ":sync",
"//base", "//base",
"//components/browser_sync", "//components/browser_sync",
"//components/reading_list/core",
"//components/sync", "//components/sync",
"//ios/chrome/browser/browser_state:test_support", "//ios/chrome/browser/browser_state:test_support",
"//ios/web:test_support", "//ios/web:test_support",
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "components/browser_sync/browser_sync_switches.h" #include "components/browser_sync/browser_sync_switches.h"
#include "components/browser_sync/profile_sync_service.h" #include "components/browser_sync/profile_sync_service.h"
#include "components/reading_list/core/reading_list_switches.h"
#include "components/sync/base/model_type.h" #include "components/sync/base/model_type.h"
#include "components/sync/driver/data_type_controller.h" #include "components/sync/driver/data_type_controller.h"
#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h"
...@@ -45,6 +46,9 @@ class IOSChromeProfileSyncServiceFactoryTest : public testing::Test { ...@@ -45,6 +46,9 @@ class IOSChromeProfileSyncServiceFactoryTest : public testing::Test {
datatypes.push_back(syncer::PASSWORDS); datatypes.push_back(syncer::PASSWORDS);
datatypes.push_back(syncer::PREFERENCES); datatypes.push_back(syncer::PREFERENCES);
datatypes.push_back(syncer::PRIORITY_PREFERENCES); datatypes.push_back(syncer::PRIORITY_PREFERENCES);
if (reading_list::switches::IsReadingListEnabled()) {
datatypes.push_back(syncer::READING_LIST);
}
datatypes.push_back(syncer::SESSIONS); datatypes.push_back(syncer::SESSIONS);
datatypes.push_back(syncer::PROXY_TABS); datatypes.push_back(syncer::PROXY_TABS);
datatypes.push_back(syncer::TYPED_URLS); datatypes.push_back(syncer::TYPED_URLS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment