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

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

Issue 240443006: Remove native VK window height logic and wait for resizeTo to setup VK window height (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
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 28 matching lines...) Expand all
39 base::LazyInstance<base::Time> g_keyboard_load_time_start = 39 base::LazyInstance<base::Time> g_keyboard_load_time_start =
40 LAZY_INSTANCE_INITIALIZER; 40 LAZY_INSTANCE_INITIALIZER;
41 41
42 bool g_accessibility_keyboard_enabled = false; 42 bool g_accessibility_keyboard_enabled = false;
43 43
44 base::LazyInstance<GURL> g_override_content_url = LAZY_INSTANCE_INITIALIZER; 44 base::LazyInstance<GURL> g_override_content_url = LAZY_INSTANCE_INITIALIZER;
45 45
46 // The ratio between the height of the keyboard and the screen when using the 46 // The ratio between the height of the keyboard and the screen when using the
47 // usability keyboard. 47 // usability keyboard.
48 const float kUsabilityKeyboardHeightRatio = 1.0f; 48 const float kUsabilityKeyboardHeightRatio = 1.0f;
49 const float kInitialHeightRatio = 0.0f;
kevers 2014/04/22 17:45:23 Please add a comment. With the value now being 0
bshe 2014/04/23 01:08:53 Done.
49 50
50 // The default ratio between the height of the keyboard and the screen. 51 float GetKeyboardHeightRatio() {
51 const float kDefaultKeyboardHeightRatio = 0.41f;
52
53 // The ratio between the height of the keyboard and the screen when using the
54 // accessibility keyboard.
55 const float kAccessibilityKeyboardHeightRatio = 0.3f;
56
57 float GetKeyboardHeightRatio(){
58 if (keyboard::IsKeyboardUsabilityExperimentEnabled()) { 52 if (keyboard::IsKeyboardUsabilityExperimentEnabled()) {
59 return kUsabilityKeyboardHeightRatio; 53 return kUsabilityKeyboardHeightRatio;
60 } else if (keyboard::GetAccessibilityKeyboardEnabled()) { 54 } else {
61 return kAccessibilityKeyboardHeightRatio; 55 return kInitialHeightRatio;
62 } 56 }
63 return kDefaultKeyboardHeightRatio;
64 } 57 }
65 58
66 bool g_touch_keyboard_enabled = false; 59 bool g_touch_keyboard_enabled = false;
67 60
68 } // namespace 61 } // namespace
69 62
70 namespace keyboard { 63 namespace keyboard {
71 64
72 gfx::Rect DefaultKeyboardBoundsFromWindowBounds( 65 gfx::Rect DefaultKeyboardBoundsFromWindowBounds(
73 const gfx::Rect& window_bounds) { 66 const gfx::Rect& window_bounds) {
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 327 }
335 328
336 void LogKeyboardControlEvent(KeyboardControlEvent event) { 329 void LogKeyboardControlEvent(KeyboardControlEvent event) {
337 UMA_HISTOGRAM_ENUMERATION( 330 UMA_HISTOGRAM_ENUMERATION(
338 "VirtualKeyboard.KeyboardControlEvent", 331 "VirtualKeyboard.KeyboardControlEvent",
339 event, 332 event,
340 keyboard::KEYBOARD_CONTROL_MAX); 333 keyboard::KEYBOARD_CONTROL_MAX);
341 } 334 }
342 335
343 } // namespace keyboard 336 } // namespace keyboard
OLDNEW
« ui/keyboard/keyboard_layout_manager.cc ('K') | « ui/keyboard/keyboard_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698