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

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

Issue 29943002: Limit display of the virtual keyboard to state changes triggered from a user gesture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ash_unittests Created 6 years, 11 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_controller_unittest.cc ('k') | ui/views/controls/textfield/textfield.h » ('j') | 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 159 }
160 return true; 160 return true;
161 } 161 }
162 162
163 const void MarkKeyboardLoadStarted() { 163 const void MarkKeyboardLoadStarted() {
164 if (!g_keyboard_load_time_start.Get().ToInternalValue()) 164 if (!g_keyboard_load_time_start.Get().ToInternalValue())
165 g_keyboard_load_time_start.Get() = base::Time::Now(); 165 g_keyboard_load_time_start.Get() = base::Time::Now();
166 } 166 }
167 167
168 const void MarkKeyboardLoadFinished() { 168 const void MarkKeyboardLoadFinished() {
169 // Possible to get a load finished without a start if navigating directly to
170 // chrome://keyboard.
171 if (!g_keyboard_load_time_start.Get().ToInternalValue())
172 return;
173
169 // It should not be possible to finish loading the keyboard without starting 174 // It should not be possible to finish loading the keyboard without starting
170 // to load it first. 175 // to load it first.
171 DCHECK(g_keyboard_load_time_start.Get().ToInternalValue()); 176 DCHECK(g_keyboard_load_time_start.Get().ToInternalValue());
172 177
173 static bool logged = false; 178 static bool logged = false;
174 if (!logged) { 179 if (!logged) {
175 // Log the delta only once. 180 // Log the delta only once.
176 UMA_HISTOGRAM_TIMES( 181 UMA_HISTOGRAM_TIMES(
177 "VirtualKeyboard.FirstLoadTime", 182 "VirtualKeyboard.FirstLoadTime",
178 base::Time::Now() - g_keyboard_load_time_start.Get()); 183 base::Time::Now() - g_keyboard_load_time_start.Get());
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 256 }
252 257
253 void LogKeyboardControlEvent(KeyboardControlEvent event) { 258 void LogKeyboardControlEvent(KeyboardControlEvent event) {
254 UMA_HISTOGRAM_ENUMERATION( 259 UMA_HISTOGRAM_ENUMERATION(
255 "VirtualKeyboard.KeyboardControlEvent", 260 "VirtualKeyboard.KeyboardControlEvent",
256 event, 261 event,
257 keyboard::KEYBOARD_CONTROL_MAX); 262 keyboard::KEYBOARD_CONTROL_MAX);
258 } 263 }
259 264
260 } // namespace keyboard 265 } // namespace keyboard
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard_controller_unittest.cc ('k') | ui/views/controls/textfield/textfield.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698