diff options
author | brettw <brettw@chromium.org> | 2016-02-23 11:17:41 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-23 19:20:23 +0000 |
commit | 7a5d62652384fe38454e12f9559a518924124078 (patch) | |
tree | ac2d356e132d1f61908644941a573dddbca92de8 | |
parent | e1528cbd6c62946c89e2facf730098fbfdfbfdfc (diff) | |
download | chromium_src-7a5d62652384fe38454e12f9559a518924124078.zip chromium_src-7a5d62652384fe38454e12f9559a518924124078.tar.gz chromium_src-7a5d62652384fe38454e12f9559a518924124078.tar.bz2 |
Convert enable_one_click_signin to new buildflag system
This flag is only used in a few places in Chrome
Review URL: https://codereview.chromium.org/1718093005
Cr-Commit-Position: refs/heads/master@{#377038}
-rw-r--r-- | build/common.gypi | 3 | ||||
-rw-r--r-- | build/config/BUILD.gn | 3 | ||||
-rw-r--r-- | build/config/features.gni | 2 | ||||
-rw-r--r-- | chrome/browser/ui/browser_window.h | 3 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/browser_window_cocoa.h | 3 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/browser_window_cocoa.mm | 5 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_view.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_view.h | 3 | ||||
-rw-r--r-- | chrome/chrome_features.gyp | 1 | ||||
-rw-r--r-- | chrome/common/BUILD.gn | 1 | ||||
-rw-r--r-- | chrome/common/features.gni | 2 | ||||
-rw-r--r-- | chrome/common/url_constants.cc | 4 | ||||
-rw-r--r-- | chrome/common/url_constants.h | 2 | ||||
-rw-r--r-- | chrome/test/BUILD.gn | 1 | ||||
-rw-r--r-- | chrome/test/base/test_browser_window.h | 3 | ||||
-rw-r--r-- | tools/gn/docs/cookbook.md | 2 |
16 files changed, 23 insertions, 20 deletions
diff --git a/build/common.gypi b/build/common.gypi index 8afb065..55bde27 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -2743,9 +2743,6 @@ ['use_clipboard_aurax11==1', { 'defines': ['USE_CLIPBOARD_AURAX11=1'], }], - ['enable_one_click_signin==1', { - 'defines': ['ENABLE_ONE_CLICK_SIGNIN'], - }], ['image_loader_extension==1', { 'defines': ['IMAGE_LOADER_EXTENSION=1'], }], diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index 32ec333..4e43bb2 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -228,9 +228,6 @@ config("feature_flags") { if (enable_image_loader_extension) { defines += [ "IMAGE_LOADER_EXTENSION=1" ] } - if (enable_one_click_signin) { - defines += [ "ENABLE_ONE_CLICK_SIGNIN" ] - } if (enable_hidpi) { defines += [ "ENABLE_HIDPI=1" ] } diff --git a/build/config/features.gni b/build/config/features.gni index df6192a..acac858 100644 --- a/build/config/features.gni +++ b/build/config/features.gni @@ -72,8 +72,6 @@ declare_args() { enable_autofill_dialog = !is_ios - enable_one_click_signin = is_win || is_mac || (is_linux && !is_chromeos) - enable_remoting = !is_ios && !is_chromecast && !is_headless # Enable hole punching for the protected video. diff --git a/chrome/browser/ui/browser_window.h b/chrome/browser/ui/browser_window.h index 467a1ca..90564a8 100644 --- a/chrome/browser/ui/browser_window.h +++ b/chrome/browser/ui/browser_window.h @@ -15,6 +15,7 @@ #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" #include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" +#include "chrome/common/features.h" #include "components/content_settings/core/common/content_settings_types.h" #include "components/security_state/security_state_model.h" #include "components/signin/core/browser/signin_header_helper.h" @@ -257,7 +258,7 @@ class BrowserWindow : public ui::BaseWindow { translate::TranslateErrors::Type error_type, bool is_user_gesture) = 0; -#if defined(ENABLE_ONE_CLICK_SIGNIN) +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) enum OneClickSigninBubbleType { ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE, ONE_CLICK_SIGNIN_BUBBLE_TYPE_MODAL_DIALOG, diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.h b/chrome/browser/ui/cocoa/browser_window_cocoa.h index 17eadf0..a6629e2 100644 --- a/chrome/browser/ui/cocoa/browser_window_cocoa.h +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.h @@ -12,6 +12,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/search/search_model_observer.h" #include "chrome/browser/ui/tabs/tab_utils.h" +#include "chrome/common/features.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/security_state/security_state_model.h" #include "ui/base/ui_base_types.h" @@ -112,7 +113,7 @@ class BrowserWindowCocoa translate::TranslateStep step, translate::TranslateErrors::Type error_type, bool is_user_gesture) override; -#if defined(ENABLE_ONE_CLICK_SIGNIN) +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) void ShowOneClickSigninBubble( OneClickSigninBubbleType type, const base::string16& email, diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm index c425643..f0463f8 100644 --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm @@ -53,6 +53,7 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/web_applications/web_app.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/features.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "components/bookmarks/common/bookmark_pref_names.h" @@ -71,7 +72,7 @@ #include "ui/events/keycodes/keyboard_codes.h" #include "ui/gfx/geometry/rect.h" -#if defined(ENABLE_ONE_CLICK_SIGNIN) +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) #import "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h" #import "chrome/browser/ui/cocoa/one_click_signin_dialog_controller.h" #endif @@ -641,7 +642,7 @@ void BrowserWindowCocoa::ShowTranslateBubble( errorType:error_type]; } -#if defined(ENABLE_ONE_CLICK_SIGNIN) +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) void BrowserWindowCocoa::ShowOneClickSigninBubble( OneClickSigninBubbleType type, const base::string16& email, diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 8f1096b..2edae31 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -101,6 +101,7 @@ #include "chrome/browser/ui/window_sizer/window_sizer.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/command.h" +#include "chrome/common/features.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "chrome/grit/chromium_strings.h" @@ -172,7 +173,7 @@ #include "ui/views/win/scoped_fullscreen_visibility.h" #endif -#if defined(ENABLE_ONE_CLICK_SIGNIN) +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) #include "chrome/browser/ui/sync/one_click_signin_bubble_delegate.h" #include "chrome/browser/ui/sync/one_click_signin_bubble_links_delegate.h" #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" @@ -1337,7 +1338,7 @@ void BrowserView::ShowTranslateBubble( GetToolbarView()->OnBubbleCreatedForAnchor(anchor_view, bubble_widget); } -#if defined(ENABLE_ONE_CLICK_SIGNIN) +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) void BrowserView::ShowOneClickSigninBubble( OneClickSigninBubbleType type, const base::string16& email, diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h index ccc436a..1660dd7 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -31,6 +31,7 @@ #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" #include "chrome/browser/ui/views/load_complete_listener.h" +#include "chrome/common/features.h" #include "components/omnibox/browser/omnibox_popup_model_observer.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/models/simple_menu_model.h" @@ -333,7 +334,7 @@ class BrowserView : public BrowserWindow, translate::TranslateStep step, translate::TranslateErrors::Type error_type, bool is_user_gesture) override; -#if defined(ENABLE_ONE_CLICK_SIGNIN) +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) void ShowOneClickSigninBubble( OneClickSigninBubbleType type, const base::string16& email, diff --git a/chrome/chrome_features.gyp b/chrome/chrome_features.gyp index deb1b98..11cbdda 100644 --- a/chrome/chrome_features.gyp +++ b/chrome/chrome_features.gyp @@ -15,6 +15,7 @@ 'buildflag_header_path': 'chrome/common/features.h', 'buildflag_flags': [ 'ENABLE_GOOGLE_NOW=<(enable_google_now)', + 'ENABLE_ONE_CLICK_SIGNIN=<(enable_one_click_signin)', 'ANDROID_JAVA_UI=<(android_java_ui)', 'USE_VULCANIZE=<(use_vulcanize)', ], diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index d454606..94b6d80 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn @@ -42,6 +42,7 @@ buildflag_header("features") { header = "features.h" flags = [ "ENABLE_GOOGLE_NOW=$enable_google_now", + "ENABLE_ONE_CLICK_SIGNIN=$enable_one_click_signin", "ANDROID_JAVA_UI=$android_java_ui", "USE_VULCANIZE=$use_vulcanize", ] diff --git a/chrome/common/features.gni b/chrome/common/features.gni index 7095deb..1e78625 100644 --- a/chrome/common/features.gni +++ b/chrome/common/features.gni @@ -19,6 +19,8 @@ declare_args() { use_vulcanize = true } +enable_one_click_signin = is_win || is_mac || (is_linux && !is_chromeos) + chrome_grit_defines = [ "enable_google_now=$enable_google_now", "use_vulcanize=$use_vulcanize", diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index 3f9676b..6ed9e2a 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc @@ -427,13 +427,13 @@ const char kChromeAccessibilitySettingsURL[] = "/chromevox/background/options.html"; #endif // defined(OS_CHROMEOS) -#if defined(ENABLE_ONE_CLICK_SIGNIN) +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) const char kChromeSyncLearnMoreURL[] = "https://support.google.com/chrome/answer/165139"; const char kChromeSyncMergeTroubleshootingURL[] = "https://support.google.com/chrome/answer/1181420#merge"; -#endif // defined(ENABLE_ONE_CLICK_SIGNIN) +#endif // BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) #if defined(OS_MACOSX) const char kChromeEnterpriseSignInLearnMoreURL[] = diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h index d57d6ea..3c5b6fd 100644 --- a/chrome/common/url_constants.h +++ b/chrome/common/url_constants.h @@ -364,7 +364,7 @@ extern const char kChromeAccessibilityHelpURL[]; extern const char kChromeAccessibilitySettingsURL[]; #endif -#if defined (ENABLE_ONE_CLICK_SIGNIN) +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) // "Learn more" URL for the one click signin infobar. extern const char kChromeSyncLearnMoreURL[]; diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 15ffb40..da5984a 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn @@ -8,6 +8,7 @@ import("//build/config/crypto.gni") import("//build/config/features.gni") import("//build/config/ui.gni") import("//chrome/chrome_tests.gni") +import("//chrome/common/features.gni") import("//chrome/test/base/js2gtest.gni") import("//testing/test.gni") diff --git a/chrome/test/base/test_browser_window.h b/chrome/test/base/test_browser_window.h index c4261b2..49e7c4a 100644 --- a/chrome/test/base/test_browser_window.h +++ b/chrome/test/base/test_browser_window.h @@ -12,6 +12,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/location_bar/location_bar.h" +#include "chrome/common/features.h" class LocationBarTesting; class OmniboxView; @@ -108,7 +109,7 @@ class TestBrowserWindow : public BrowserWindow { translate::TranslateStep step, translate::TranslateErrors::Type error_type, bool is_user_gesture) override {} -#if defined(ENABLE_ONE_CLICK_SIGNIN) +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) void ShowOneClickSigninBubble( OneClickSigninBubbleType type, const base::string16& email, diff --git a/tools/gn/docs/cookbook.md b/tools/gn/docs/cookbook.md index c328563..7b872d5 100644 --- a/tools/gn/docs/cookbook.md +++ b/tools/gn/docs/cookbook.md @@ -244,7 +244,7 @@ places are noted in the table below. | `enable_hidpi` (0/1) | `enable_hidpi` (true/false) | `//build/config/ui.gni` | | `enable_managed_users` (0/1) | `enable_managed_users` (true/false) | `//build/config/features.gni` | | `enable_mdns` (0/1) | `enable_mdns` (true/false) | `//build/config/features.gni` | -| `enable_one_click_signin` (0/1) | `enable_one_click_signin` (true/false) | `//build/config/features.gni` | +| `enable_one_click_signin` (0/1) | `enable_one_click_signin` (true/false) | `//chrome/common/features.gni` | | `enable_pepper_cdms` (0/1) | `enable_pepper_cdms` (true/false) | `//build/config/features.gni` | | `enable_plugins` (0/1) | `enable_plugins` (true/false) | `//build/config/features.gni` | | `enable_plugin_installation` (0/1) | `enable_plugin_installation` (true/false) | `//build/config/features.gni` | |