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

Unified Diff: ui/base/ui_base_switches_util.cc

Issue 173803002: Redesigns the text input focus handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added an unittest and thread checker. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/ui_base_switches_util.cc
diff --git a/ui/base/ui_base_switches_util.cc b/ui/base/ui_base_switches_util.cc
index 3089607af86617537edc617cf670492488a10453..6a7df0eb441136b81baf683dd3fb144b648c7590 100644
--- a/ui/base/ui_base_switches_util.cc
+++ b/ui/base/ui_base_switches_util.cc
@@ -7,8 +7,20 @@
#include "base/command_line.h"
#include "ui/base/ui_base_switches.h"
+namespace {
+
+bool g_text_input_focus_manager_enabled_for_testing = false;
+
+} // namespace
+
namespace switches {
+bool IsTextInputFocusManagerEnabled() {
+ return g_text_input_focus_manager_enabled_for_testing
+ || CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableTextInputFocusManager);
+}
+
bool IsTouchDragDropEnabled() {
#if defined(OS_CHROMEOS)
return !CommandLine::ForCurrentProcess()->HasSwitch(
@@ -29,4 +41,10 @@ bool IsTouchEditingEnabled() {
#endif
}
+ScopedTextInputFocusManagerForTesting::ScopedTextInputFocusManagerForTesting()
+ : auto_reset_(&g_text_input_focus_manager_enabled_for_testing, true) {}
+
+ScopedTextInputFocusManagerForTesting::
+~ScopedTextInputFocusManagerForTesting() {}
+
} // namespace switches

Powered by Google App Engine
This is Rietveld 408576698