diff options
Diffstat (limited to 'chrome/browser')
13 files changed, 17 insertions, 97 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 2d0c2ff..d322582 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -28,6 +28,7 @@ #include "components/autofill/core/common/autofill_switches.h" #include "components/cloud_devices/common/cloud_devices_switches.h" #include "components/dom_distiller/core/dom_distiller_switches.h" +#include "components/enhanced_bookmarks/enhanced_bookmark_switches.h" #include "components/metrics/metrics_hashes.h" #include "components/nacl/common/nacl_switches.h" #include "components/omnibox/browser/omnibox_switches.h" diff --git a/chrome/browser/android/bookmarks/bookmarks_bridge.cc b/chrome/browser/android/bookmarks/bookmarks_bridge.cc index 9406dda..a9ba6bb 100644 --- a/chrome/browser/android/bookmarks/bookmarks_bridge.cc +++ b/chrome/browser/android/bookmarks/bookmarks_bridge.cc @@ -10,7 +10,6 @@ #include "base/i18n/string_compare.h" #include "base/prefs/pref_service.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" -#include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" @@ -24,6 +23,7 @@ #include "components/bookmarks/browser/scoped_group_bookmark_actions.h" #include "components/bookmarks/common/android/bookmark_type.h" #include "components/bookmarks/managed/managed_bookmark_service.h" +#include "components/enhanced_bookmarks/enhanced_bookmark_features.h" #include "components/query_parser/query_parser.h" #include "components/signin/core/browser/signin_manager.h" #include "components/undo/bookmark_undo_service.h" @@ -142,7 +142,7 @@ static jlong Init(JNIEnv* env, jobject obj, jobject j_profile) { static jboolean IsEnhancedBookmarksFeatureEnabled(JNIEnv* env, jclass clazz, jobject j_profile) { - return IsEnhancedBookmarksEnabled(); + return enhanced_bookmarks::IsEnhancedBookmarksEnabled(); } jboolean BookmarksBridge::IsEditBookmarksEnabled(JNIEnv* env, jobject obj) { @@ -713,7 +713,7 @@ base::string16 BookmarksBridge::GetTitle(const BookmarkNode* node) const { return partner_bookmarks_shim_->GetTitle(node); if (node == bookmark_model_->bookmark_bar_node() - && IsEnhancedBookmarksEnabled()) { + && enhanced_bookmarks::IsEnhancedBookmarksEnabled()) { return l10n_util::GetStringUTF16(IDS_ENHANCED_BOOKMARK_BAR_FOLDER_NAME); } diff --git a/chrome/browser/android/chrome_startup_flags.cc b/chrome/browser/android/chrome_startup_flags.cc index ed0dfb3..9478cc7 100644 --- a/chrome/browser/android/chrome_startup_flags.cc +++ b/chrome/browser/android/chrome_startup_flags.cc @@ -14,7 +14,7 @@ #include "base/sys_info.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" -#include "content/public/common/content_switches.h" +#include "components/dom_distiller/core/dom_distiller_switches.h" #include "media/base/media_switches.h" namespace { diff --git a/chrome/browser/bookmarks/enhanced_bookmarks_features.cc b/chrome/browser/bookmarks/enhanced_bookmarks_features.cc deleted file mode 100644 index 4a33c1e..0000000 --- a/chrome/browser/bookmarks/enhanced_bookmarks_features.cc +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2013 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. - -#include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" - -#include <string> - -#include "base/command_line.h" -#include "base/prefs/pref_service.h" -#include "build/build_config.h" -#include "chrome/common/chrome_switches.h" -#include "components/variations/variations_associated_data.h" - -namespace { - -const char kFieldTrialName[] = "EnhancedBookmarks"; - -} // namespace - -bool IsEnhancedBookmarksEnabled() { - // Enhanced bookmarks is not used on desktop, so it shouldn't be calling this - // function. -#if !defined(OS_IOS) && !defined(OS_ANDROID) - NOTREACHED(); -#endif // !defined(OS_IOS) || !defined(OS_ANDROID) - - // kEnhancedBookmarksExperiment flag could have values "", "1" and "0". "" - - // default, "0" - user opted out, "1" - user opted in. Tests also use the - // command line flag to force enhanced bookmark to be on. - std::string switch_value = - base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kEnhancedBookmarksExperiment); - if (switch_value == "1") - return true; - if (switch_value == "0") - return false; - - // Check that the "id" param is present. This is a legacy of the desktop - // implementation providing the extension id via param. This probably should - // be replaced with code that checks the experiment name instead. - return !variations::GetVariationParamValue(kFieldTrialName, "id").empty(); -} - -bool IsEnableDomDistillerSet() { - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableDomDistiller)) { - return true; - } - if (variations::GetVariationParamValue(kFieldTrialName, - "enable-dom-distiller") == "1") - return true; - - return false; -} - -bool IsEnableSyncArticlesSet() { - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableSyncArticles)) { - return true; - } - if (variations::GetVariationParamValue(kFieldTrialName, - "enable-sync-articles") == "1") - return true; - - return false; -} diff --git a/chrome/browser/bookmarks/enhanced_bookmarks_features.h b/chrome/browser/bookmarks/enhanced_bookmarks_features.h deleted file mode 100644 index 3786f59..0000000 --- a/chrome/browser/bookmarks/enhanced_bookmarks_features.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2013 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. - -#ifndef CHROME_BROWSER_BOOKMARKS_ENHANCED_BOOKMARKS_FEATURES_H_ -#define CHROME_BROWSER_BOOKMARKS_ENHANCED_BOOKMARKS_FEATURES_H_ - -// Returns true if enhanced bookmarks is enabled. -bool IsEnhancedBookmarksEnabled(); - -// Returns true when flag enable-dom-distiller is set or enabled from Finch. -bool IsEnableDomDistillerSet(); - -// Returns true when flag enable-sync-articles is set or enabled from Finch. -bool IsEnableSyncArticlesSet(); - -#endif // CHROME_BROWSER_BOOKMARKS_ENHANCED_BOOKMARKS_FEATURES_H_ diff --git a/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc b/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc index 4ca2fc8..e6bca14 100644 --- a/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc +++ b/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc @@ -12,7 +12,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" -#include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "components/dom_distiller/content/browser/distiller_javascript_utils.h" @@ -22,6 +21,7 @@ #include "components/dom_distiller/core/distiller.h" #include "components/dom_distiller/core/dom_distiller_service.h" #include "components/dom_distiller/core/dom_distiller_store.h" +#include "components/dom_distiller/core/dom_distiller_switches.h" #include "components/dom_distiller/core/dom_distiller_test_util.h" #include "components/dom_distiller/core/fake_distiller.h" #include "components/dom_distiller/core/fake_distiller_page.h" diff --git a/chrome/browser/dom_distiller/profile_utils.cc b/chrome/browser/dom_distiller/profile_utils.cc index 52f8c22..9ae53ef 100644 --- a/chrome/browser/dom_distiller/profile_utils.cc +++ b/chrome/browser/dom_distiller/profile_utils.cc @@ -10,10 +10,10 @@ #include "chrome/browser/dom_distiller/lazy_dom_distiller_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_isolated_world_ids.h" -#include "chrome/common/chrome_switches.h" #include "components/dom_distiller/content/browser/distiller_javascript_utils.h" #include "components/dom_distiller/content/browser/dom_distiller_viewer_source.h" #include "components/dom_distiller/content/browser/external_feedback_reporter.h" +#include "components/dom_distiller/core/dom_distiller_switches.h" #include "components/dom_distiller/core/url_constants.h" #if defined(OS_ANDROID) diff --git a/chrome/browser/dom_distiller/tab_utils_browsertest.cc b/chrome/browser/dom_distiller/tab_utils_browsertest.cc index 4de6dfa..5e34a74 100644 --- a/chrome/browser/dom_distiller/tab_utils_browsertest.cc +++ b/chrome/browser/dom_distiller/tab_utils_browsertest.cc @@ -10,12 +10,12 @@ #include "chrome/browser/dom_distiller/tab_utils.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" -#include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "components/dom_distiller/content/browser/distiller_javascript_utils.h" #include "components/dom_distiller/content/browser/web_contents_main_frame_observer.h" #include "components/dom_distiller/core/dom_distiller_service.h" +#include "components/dom_distiller/core/dom_distiller_switches.h" #include "components/dom_distiller/core/task_tracker.h" #include "components/dom_distiller/core/url_constants.h" #include "components/dom_distiller/core/url_utils.h" diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc index 04d821c..e4b1cbd 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/sync/profile_sync_components_factory_impl.h" + #include "base/command_line.h" #include "build/build_config.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" -#include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/password_manager/password_store_factory.h" @@ -32,7 +33,6 @@ #include "chrome/browser/sync/glue/typed_url_change_processor.h" #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" #include "chrome/browser/sync/glue/typed_url_model_associator.h" -#include "chrome/browser/sync/profile_sync_components_factory_impl.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/sessions/session_data_type_controller.h" @@ -50,6 +50,7 @@ #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/autofill/core/common/autofill_pref_names.h" #include "components/autofill/core/common/autofill_switches.h" +#include "components/dom_distiller/core/dom_distiller_features.h" #include "components/dom_distiller/core/dom_distiller_service.h" #include "components/history/core/browser/history_service.h" #include "components/password_manager/core/browser/password_store.h" @@ -325,7 +326,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( } // Article sync is disabled by default. Register only if explicitly enabled. - if (IsEnableSyncArticlesSet()) { + if (dom_distiller::IsEnableSyncArticlesSet()) { pss->RegisterDataTypeController( new UIDataTypeController( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index ab25a9a..abb1233 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -30,10 +30,10 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/tab_strip_model_utils.h" #include "chrome/browser/ui/webui/inspect_ui.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/content_restriction.h" #include "chrome/common/pref_names.h" #include "chrome/common/profiling.h" +#include "components/dom_distiller/core/dom_distiller_switches.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc index 7668090..c5e09f0 100644 --- a/chrome/browser/ui/tab_helpers.cc +++ b/chrome/browser/ui/tab_helpers.cc @@ -41,6 +41,7 @@ #include "components/autofill/content/browser/content_autofill_driver_factory.h" #include "components/autofill/core/browser/autofill_manager.h" #include "components/dom_distiller/content/browser/web_contents_main_frame_observer.h" +#include "components/dom_distiller/core/dom_distiller_switches.h" #include "components/history/content/browser/web_contents_top_sites_observer.h" #include "components/history/core/browser/top_sites.h" #include "components/password_manager/core/browser/password_manager.h" diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index 62a15b2..dff0282 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -45,6 +45,7 @@ #include "chrome/common/profiling.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" +#include "components/dom_distiller/core/dom_distiller_switches.h" #include "components/signin/core/browser/signin_manager.h" #include "components/signin/core/common/profile_management_switches.h" #include "components/ui/zoom/zoom_controller.h" diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index 992871c..654fadf 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc @@ -12,7 +12,6 @@ #include "base/prefs/pref_service.h" #include "base/thread_task_runner_handle.h" #include "chrome/browser/about_flags.h" -#include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" @@ -55,6 +54,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "components/dom_distiller/core/dom_distiller_constants.h" +#include "components/dom_distiller/core/dom_distiller_features.h" #include "components/dom_distiller/core/dom_distiller_service.h" #include "components/dom_distiller/core/url_constants.h" #include "components/dom_distiller/webui/dom_distiller_ui.h" @@ -566,7 +566,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, if (IsAboutUI(url)) return &NewWebUI<AboutUI>; - if (IsEnableDomDistillerSet() && + if (dom_distiller::IsEnableDomDistillerSet() && url.host() == dom_distiller::kChromeUIDomDistillerHost) { return &NewWebUI<dom_distiller::DomDistillerUi>; } |