diff options
-rw-r--r-- | chrome/app/generated_resources.grd | 9 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 7 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/oobe_browsertest.cc | 30 | ||||
-rw-r--r-- | chrome/browser/defaults.cc | 8 | ||||
-rw-r--r-- | chrome/browser/defaults.h | 6 | ||||
-rw-r--r-- | chrome/browser/renderer_preferences_util.cc | 9 | ||||
-rw-r--r-- | chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc | 3 | ||||
-rw-r--r-- | content/renderer/render_view_impl.cc | 3 | ||||
-rw-r--r-- | tools/metrics/histograms/histograms.xml | 1 | ||||
-rw-r--r-- | ui/base/ui_base_switches.cc | 3 | ||||
-rw-r--r-- | ui/base/ui_base_switches.h | 1 | ||||
-rw-r--r-- | ui/base/ui_base_switches_util.cc | 12 | ||||
-rw-r--r-- | ui/base/ui_base_switches_util.h | 1 |
13 files changed, 36 insertions, 57 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index a516413..2461b34 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6766,7 +6766,14 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_DESCRIPTION" desc="Description for the flag that enables Smart Lock to require close proximity between the phone and the Chromebook in order to unlock the Chromebook."> Enables a Smart Lock setting that restricts unlocking to only work when your phone is very close to (roughly, within an arm's length of) the Chrome device. </message> - + <if expr="toolkit_views"> + <message name="IDS_FLAGS_DISABLE_LINK_DISAMBIGUATION_POPUP_NAME" desc="Title for the flag to disable the Link Disambiguation Popup, a bubble that appears over the web content screen when the user uses a touchscreen to touch a link but accidentally touches more than one link in a single gesture. The bubble appears with a zoomed-in view of the area around their touch, allowing them to more easily select the element they wanted."> + Disable Link Disambiguation Popup. + </message> + <message name="IDS_FLAGS_DISABLE_LINK_DISAMBIGUATION_POPUP_DESCRIPTION" desc="Description for the flag to disable the Link Disambiguation Popup, a feature on touchscreens that when enabled will cause a small zoomed popup to appear over a group of links the user has touched, allowing for selection of links on pages not yet optimized for touch input."> + Disable the zoomed bubble that appears on touchscreens when accidentally touching more than one link at a time. + </message> + </if> <!-- Crashes --> <message name="IDS_CRASHES_TITLE" desc="Title for the chrome://crashes page."> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index b635ba9..4b25b4e 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1669,6 +1669,13 @@ const Experiment kExperiments[] = { kOsCrOS | kOsWin | kOsLinux, SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting) }, + { + "disable-link-disambiguation-popup", + IDS_FLAGS_DISABLE_LINK_DISAMBIGUATION_POPUP_NAME, + IDS_FLAGS_DISABLE_LINK_DISAMBIGUATION_POPUP_DESCRIPTION, + kOsCrOS | kOsWin, + SINGLE_VALUE_TYPE(switches::kDisableLinkDisambiguationPopup) + }, #endif #if defined(ENABLE_EXTENSIONS) { diff --git a/chrome/browser/chromeos/login/oobe_browsertest.cc b/chrome/browser/chromeos/login/oobe_browsertest.cc index c9ae41c..51a33ec 100644 --- a/chrome/browser/chromeos/login/oobe_browsertest.cc +++ b/chrome/browser/chromeos/login/oobe_browsertest.cc @@ -8,16 +8,12 @@ #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" #include "chrome/browser/chromeos/login/ui/webui_login_display.h" -#include "chrome/browser/chromeos/login/ui/webui_login_view.h" #include "chrome/browser/chromeos/login/wizard_controller.h" -#include "chrome/browser/defaults.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h" #include "chromeos/chromeos_switches.h" -#include "content/public/browser/web_contents.h" -#include "content/public/common/renderer_preferences.h" #include "content/public/test/test_utils.h" #include "google_apis/gaia/fake_gaia.h" #include "google_apis/gaia/gaia_switches.h" @@ -125,30 +121,4 @@ IN_PROC_BROWSER_TEST_F(OobeTest, Accelerator) { OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); } -IN_PROC_BROWSER_TEST_F(OobeTest, LinkDisambiguationDefaultRespected) { - chromeos::LoginDisplayHostImpl* display_host = - static_cast<chromeos::LoginDisplayHostImpl*>( - chromeos::LoginDisplayHostImpl::default_host()); - ASSERT_TRUE(display_host); - chromeos::WebUILoginView* login_view = display_host->GetWebUILoginView(); - ASSERT_TRUE(login_view); - content::WebContents* web_contents = login_view->GetWebContents(); - ASSERT_TRUE(web_contents); - content::RendererPreferences* prefs = web_contents->GetMutableRendererPrefs(); - ASSERT_TRUE(prefs); - // Per crbug/431163 the WiFi selection dropdown doesn't support the link - // disambiguation popup for gesture events, and this feature is disabled - // within ChromeOS. Ensure that the web preferences reflect the default. - if (browser_defaults::kShowLinkDisambiguationPopup) { - EXPECT_EQ( - content::TapMultipleTargetsStrategy:: - TAP_MULTIPLE_TARGETS_STRATEGY_POPUP, - prefs->tap_multiple_targets_strategy); - } else { - EXPECT_EQ( - content::TapMultipleTargetsStrategy::TAP_MULTIPLE_TARGETS_STRATEGY_NONE, - prefs->tap_multiple_targets_strategy); - } -} - } // namespace chromeos diff --git a/chrome/browser/defaults.cc b/chrome/browser/defaults.cc index ff39b1d..6d6b6b6 100644 --- a/chrome/browser/defaults.cc +++ b/chrome/browser/defaults.cc @@ -16,14 +16,6 @@ const bool kCanToggleSystemTitleBar = true; const int kOmniboxFontPixelSize = 16; -#if defined(TOOLKIT_VIEWS) -#if defined(OS_WIN) -const bool kShowLinkDisambiguationPopup = true; -#else -const bool kShowLinkDisambiguationPopup = false; -#endif -#endif - #if defined(OS_CHROMEOS) || defined(OS_MACOSX) const bool kBrowserAliveWithNoWindows = true; const bool kShowExitMenuItem = false; diff --git a/chrome/browser/defaults.h b/chrome/browser/defaults.h index 157d561..41b16d6 100644 --- a/chrome/browser/defaults.h +++ b/chrome/browser/defaults.h @@ -33,12 +33,6 @@ const int kMiniTabWidth = 64; const int kMiniTabWidth = 56; #endif -#if defined(TOOLKIT_VIEWS) -// Whether to show a Link Disambiguation Popup Bubble if the browser detects an -// ambiguous touch event. -extern const bool kShowLinkDisambiguationPopup; -#endif - // Can the browser be alive without any browser windows? extern const bool kBrowserAliveWithNoWindows; diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc index fc0ada5..bf1e2e0 100644 --- a/chrome/browser/renderer_preferences_util.cc +++ b/chrome/browser/renderer_preferences_util.cc @@ -22,7 +22,6 @@ #endif #if defined(TOOLKIT_VIEWS) -#include "chrome/browser/defaults.h" #include "ui/views/controls/textfield/textfield.h" #endif @@ -70,14 +69,6 @@ void UpdateFromSystemSettings(content::RendererPreferences* prefs, #if defined(TOOLKIT_VIEWS) prefs->caret_blink_interval = views::Textfield::GetCaretBlinkMs() / 1000.0; - if (browser_defaults::kShowLinkDisambiguationPopup) { - prefs->tap_multiple_targets_strategy = - content::TapMultipleTargetsStrategy:: - TAP_MULTIPLE_TARGETS_STRATEGY_POPUP; - } else { - prefs->tap_multiple_targets_strategy = - content::TapMultipleTargetsStrategy::TAP_MULTIPLE_TARGETS_STRATEGY_NONE; - } #endif #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) diff --git a/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc b/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc index 8c2dce3..cf5a5d3 100644 --- a/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc +++ b/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc @@ -161,9 +161,6 @@ void ChromeWebContentsViewDelegateViews::ShowDisambiguationPopup( const base::Callback<void(ui::GestureEvent*)>& gesture_cb, const base::Callback<void(ui::MouseEvent*)>& mouse_cb) { #if defined(USE_AURA) - if (!browser_defaults::kShowLinkDisambiguationPopup) - return; - link_disambiguation_popup_.reset(new LinkDisambiguationPopup); link_disambiguation_popup_->Show( views::Widget::GetTopLevelWidgetForNativeView(GetActiveNativeView()), diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 7f38d6c..ed8b491 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -4051,6 +4051,9 @@ bool RenderViewImpl::didTapMultipleTargets( const WebSize& inner_viewport_offset, const WebRect& touch_rect, const WebVector<WebRect>& target_rects) { + if (!switches::IsLinkDisambiguationPopupEnabled()) + return false; + // Never show a disambiguation popup when accessibility is enabled, // as this interferes with "touch exploration". AccessibilityMode accessibility_mode = diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 2ef551f..c80d5bb 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -48617,6 +48617,7 @@ To add a new entry, add it with any value and run test to compute valid value. <int value="880510010" label="enable-permissions-bubbles"/> <int value="887011602" label="enable-spelling-auto-correct"/> <int value="909439558" label="disable-device-discovery"/> + <int value="929462705" label="disable-link-disambiguation-popup"/> <int value="952558794" label="enable-remote-assistance"/> <int value="980396200" label="enable-new-korean-ime"/> <int value="1022992701" label="enable-origin-chip-always"/> diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc index 2163397..8d518ea 100644 --- a/ui/base/ui_base_switches.cc +++ b/ui/base/ui_base_switches.cc @@ -15,6 +15,9 @@ const char kDisableRemoteCoreAnimation[] = "disable-remote-core-animation"; // Disables use of DWM composition for top level windows. const char kDisableDwmComposition[] = "disable-dwm-composition"; +const char kDisableLinkDisambiguationPopup[] = + "disable-link-disambiguation-popup"; + // Disables an experimental focus manager to track text input clients. const char kDisableTextInputFocusManager[] = "disable-text-input-focus-manager"; diff --git a/ui/base/ui_base_switches.h b/ui/base/ui_base_switches.h index 629f9af..920b2bf 100644 --- a/ui/base/ui_base_switches.h +++ b/ui/base/ui_base_switches.h @@ -17,6 +17,7 @@ UI_BASE_EXPORT extern const char kDisableRemoteCoreAnimation[]; #endif UI_BASE_EXPORT extern const char kDisableDwmComposition[]; +UI_BASE_EXPORT extern const char kDisableLinkDisambiguationPopup[]; UI_BASE_EXPORT extern const char kDisableTextInputFocusManager[]; UI_BASE_EXPORT extern const char kDisableTouchAdjustment[]; UI_BASE_EXPORT extern const char kDisableTouchDragDrop[]; diff --git a/ui/base/ui_base_switches_util.cc b/ui/base/ui_base_switches_util.cc index 58b85c7..a5fab1c 100644 --- a/ui/base/ui_base_switches_util.cc +++ b/ui/base/ui_base_switches_util.cc @@ -9,6 +9,18 @@ namespace switches { +bool IsLinkDisambiguationPopupEnabled() { + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableLinkDisambiguationPopup)) { + return false; + } +#if defined(OS_WIN) || defined(OS_ANDROID) + return true; +#else + return false; +#endif +} + bool IsTextInputFocusManagerEnabled() { return CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableTextInputFocusManager); diff --git a/ui/base/ui_base_switches_util.h b/ui/base/ui_base_switches_util.h index de08d1c4..213aed6 100644 --- a/ui/base/ui_base_switches_util.h +++ b/ui/base/ui_base_switches_util.h @@ -9,6 +9,7 @@ namespace switches { +UI_BASE_EXPORT bool IsLinkDisambiguationPopupEnabled(); UI_BASE_EXPORT bool IsTextInputFocusManagerEnabled(); UI_BASE_EXPORT bool IsTouchDragDropEnabled(); UI_BASE_EXPORT bool IsTouchEditingEnabled(); |