OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h" | 5 #include "chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/extensions/extension_event_router.h" | 9 #include "chrome/browser/extensions/extension_event_router.h" |
10 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 10 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 namespace { | 49 namespace { |
50 | 50 |
51 const int kDefaultKeyboardHeight = 300; | 51 const int kDefaultKeyboardHeight = 300; |
52 const int kKeyboardSlideDuration = 300; // In milliseconds | 52 const int kKeyboardSlideDuration = 300; // In milliseconds |
53 const char kOnTextInputTypeChanged[] = | 53 const char kOnTextInputTypeChanged[] = |
54 "experimental.input.virtualKeyboard.onTextInputTypeChanged"; | 54 "experimental.input.virtualKeyboard.onTextInputTypeChanged"; |
55 | 55 |
56 // The default position of the keyboard widget should be at the bottom, | 56 // The default position of the keyboard widget should be at the bottom, |
57 // spanning the entire width of the root window. | 57 // spanning the entire width of the root window. |
58 gfx::Rect GetKeyboardPosition(int height) { | 58 gfx::Rect GetKeyboardPosition(int height) { |
59 gfx::Rect area = gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()); | 59 gfx::Rect area = gfx::Screen::GetPrimaryMonitor().bounds(); |
60 return gfx::Rect(area.x(), area.y() + area.height() - height, | 60 return gfx::Rect(area.x(), area.y() + area.height() - height, |
61 area.width(), height); | 61 area.width(), height); |
62 } | 62 } |
63 | 63 |
64 } // namespace | 64 } // namespace |
65 | 65 |
66 // TODO(sad): Is the default profile always going to be the one we want? | 66 // TODO(sad): Is the default profile always going to be the one we want? |
67 | 67 |
68 class KeyboardWidget | 68 class KeyboardWidget |
69 : public views::Widget, | 69 : public views::Widget, |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 528 |
529 void VirtualKeyboardManager::OnWidgetClosing(views::Widget* widget) { | 529 void VirtualKeyboardManager::OnWidgetClosing(views::Widget* widget) { |
530 DCHECK_EQ(keyboard_, widget); | 530 DCHECK_EQ(keyboard_, widget); |
531 keyboard_ = NULL; | 531 keyboard_ = NULL; |
532 } | 532 } |
533 | 533 |
534 // static | 534 // static |
535 VirtualKeyboardManager* VirtualKeyboardManager::GetInstance() { | 535 VirtualKeyboardManager* VirtualKeyboardManager::GetInstance() { |
536 return Singleton<VirtualKeyboardManager>::get(); | 536 return Singleton<VirtualKeyboardManager>::get(); |
537 } | 537 } |
OLD | NEW |