OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_MANAGER_H_ | |
6 #define CHROME_BROWSER_UI_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_MANAGER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/memory/singleton.h" | |
10 #include "ui/views/widget/widget.h" | |
11 | |
12 class KeyboardWidget; | |
13 | |
14 // A singleton object to manage the virtual keyboard. | |
15 class VirtualKeyboardManager : public views::Widget::Observer { | |
16 public: | |
17 // Returns the singleton object. | |
18 static VirtualKeyboardManager* GetInstance(); | |
19 | |
20 // Shows the keyboard for the target widget. The events from the keyboard will | |
21 // be sent to |widget|. | |
22 // TODO(sad): Allow specifying the type of keyboard to show. | |
23 void ShowKeyboardForWidget(views::Widget* widget); | |
24 | |
25 // Hides the keyboard. | |
26 void Hide(); | |
27 | |
28 // Returns the keyboard Widget. | |
29 views::Widget* keyboard(); | |
30 | |
31 private: | |
32 friend struct DefaultSingletonTraits<VirtualKeyboardManager>; | |
33 | |
34 VirtualKeyboardManager(); | |
35 virtual ~VirtualKeyboardManager(); | |
36 | |
37 // Overridden from views::Widget::Observer. | |
38 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | |
39 | |
40 KeyboardWidget* keyboard_; | |
41 | |
42 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardManager); | |
43 }; | |
44 | |
45 #endif // CHROME_BROWSER_UI_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_MANAGER_H_ | |
OLD | NEW |