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

Side by Side Diff: ui/keyboard/keyboard_util.cc

Issue 313983002: Add flag to enable experimental features for input view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Doc tweaks. Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/keyboard/keyboard_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/keyboard/keyboard_util.h" 5 #include "ui/keyboard/keyboard_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 bool IsInputViewEnabled() { 139 bool IsInputViewEnabled() {
140 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) 140 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView))
141 return true; 141 return true;
142 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInputView)) 142 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInputView))
143 return false; 143 return false;
144 // Default value if no command line flags specified. 144 // Default value if no command line flags specified.
145 return true; 145 return true;
146 } 146 }
147 147
148 bool IsExperimentalInputViewEnabled() {
149 if (CommandLine::ForCurrentProcess()->HasSwitch(
150 switches::kEnableExperimentalInputViewFeatures)) {
151 return true;
152 }
153 return false;
154 }
155
148 bool InsertText(const base::string16& text, aura::Window* root_window) { 156 bool InsertText(const base::string16& text, aura::Window* root_window) {
149 if (!root_window) 157 if (!root_window)
150 return false; 158 return false;
151 159
152 ui::InputMethod* input_method = root_window->GetProperty( 160 ui::InputMethod* input_method = root_window->GetProperty(
153 aura::client::kRootWindowInputMethodKey); 161 aura::client::kRootWindowInputMethodKey);
154 if (!input_method) 162 if (!input_method)
155 return false; 163 return false;
156 164
157 ui::TextInputClient* tic = input_method->GetTextInputClient(); 165 ui::TextInputClient* tic = input_method->GetTextInputClient();
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 361 }
354 362
355 void LogKeyboardControlEvent(KeyboardControlEvent event) { 363 void LogKeyboardControlEvent(KeyboardControlEvent event) {
356 UMA_HISTOGRAM_ENUMERATION( 364 UMA_HISTOGRAM_ENUMERATION(
357 "VirtualKeyboard.KeyboardControlEvent", 365 "VirtualKeyboard.KeyboardControlEvent",
358 event, 366 event,
359 keyboard::KEYBOARD_CONTROL_MAX); 367 keyboard::KEYBOARD_CONTROL_MAX);
360 } 368 }
361 369
362 } // namespace keyboard 370 } // namespace keyboard
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698