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

Side by Side Diff: chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h

Issue 8461017: More surgery to remove views desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comments (move listener to ui/views/aura) Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_UI_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_MANAGER_H_ 5 #ifndef CHROME_BROWSER_UI_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_MANAGER_H_
6 #define CHROME_BROWSER_UI_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_MANAGER_H_ 6 #define CHROME_BROWSER_UI_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "ui/views/desktop/desktop_window_view.h"
11 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
12 11
13 class KeyboardWidget; 12 class KeyboardWidget;
14 13
15 // A singleton object to manage the virtual keyboard. 14 // A singleton object to manage the virtual keyboard.
16 class VirtualKeyboardManager : public views::Widget::Observer, 15 class VirtualKeyboardManager : public views::Widget::Observer {
17 public views::desktop::DesktopWindowView::Observer {
18 public: 16 public:
19 // Returns the singleton object. 17 // Returns the singleton object.
20 static VirtualKeyboardManager* GetInstance(); 18 static VirtualKeyboardManager* GetInstance();
21 19
22 // Shows the keyboard for the target widget. The events from the keyboard will 20 // Shows the keyboard for the target widget. The events from the keyboard will
23 // be sent to |widget|. 21 // be sent to |widget|.
24 // TODO(sad): Allow specifying the type of keyboard to show. 22 // TODO(sad): Allow specifying the type of keyboard to show.
25 void ShowKeyboardForWidget(views::Widget* widget); 23 void ShowKeyboardForWidget(views::Widget* widget);
26 24
27 // Hides the keyboard. 25 // Hides the keyboard.
28 void Hide(); 26 void Hide();
29 27
30 // Returns the keyboard Widget. 28 // Returns the keyboard Widget.
31 views::Widget* keyboard(); 29 views::Widget* keyboard();
32 30
33 private: 31 private:
34 friend struct DefaultSingletonTraits<VirtualKeyboardManager>; 32 friend struct DefaultSingletonTraits<VirtualKeyboardManager>;
35 33
36 VirtualKeyboardManager(); 34 VirtualKeyboardManager();
37 virtual ~VirtualKeyboardManager(); 35 virtual ~VirtualKeyboardManager();
38 36
39 // Overridden from views::Widget::Observer. 37 // Overridden from views::Widget::Observer.
40 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; 38 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
41 39
42 // Overridden from views::desktop::DesktopWindowView::Observer
43 virtual void OnDesktopBoundsChanged(const gfx::Rect& prev_bounds) OVERRIDE;
44
45 KeyboardWidget* keyboard_; 40 KeyboardWidget* keyboard_;
46 41
47 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardManager); 42 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardManager);
48 }; 43 };
49 44
50 #endif // CHROME_BROWSER_UI_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_MANAGER_H_ 45 #endif // CHROME_BROWSER_UI_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698