summaryrefslogtreecommitdiffstats
path: root/ui/keyboard/keyboard_controller_proxy.h
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-23 17:42:56 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-23 17:42:56 +0000
commitf1d5c3ad84c8148cf8e0e36ef9622d865b682f34 (patch)
tree673bf62a1d8368f14154c962f5327a14167af9a9 /ui/keyboard/keyboard_controller_proxy.h
parent72fe5d96250af420959d173f86cf5e3330a8ddfd (diff)
downloadchromium_src-f1d5c3ad84c8148cf8e0e36ef9622d865b682f34.zip
chromium_src-f1d5c3ad84c8148cf8e0e36ef9622d865b682f34.tar.gz
chromium_src-f1d5c3ad84c8148cf8e0e36ef9622d865b682f34.tar.bz2
keyboard: Simplify initialization and use in ash_shell.
After this change, executables that want to use the keyboard need to: * add 'keyboard' and 'keyboard_resources' as dependencies. Repacking keyboard_resources.pak is no longer necessary. * call keyboard::InitializeKeyboard() during startup. This installs the necessary pak file, and sets up a WebUIControllerFactory to make sure the keyboard gets the correct WebUIController. * create a KeyboardControllerProxy and a KeyboardController. BUG=none Review URL: https://codereview.chromium.org/14241037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195835 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/keyboard/keyboard_controller_proxy.h')
-rw-r--r--ui/keyboard/keyboard_controller_proxy.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/ui/keyboard/keyboard_controller_proxy.h b/ui/keyboard/keyboard_controller_proxy.h
index a656e06..985f573 100644
--- a/ui/keyboard/keyboard_controller_proxy.h
+++ b/ui/keyboard/keyboard_controller_proxy.h
@@ -5,12 +5,19 @@
#ifndef UI_KEYBOARD_KEYBOARD_CONTROLLER_PROXY_H_
#define UI_KEYBOARD_KEYBOARD_CONTROLLER_PROXY_H_
+#include "base/memory/scoped_ptr.h"
#include "ui/keyboard/keyboard_export.h"
namespace aura {
class Window;
}
+namespace content {
+class BrowserContext;
+class SiteInstance;
+class WebContents;
+}
+
namespace ui {
class InputMethod;
}
@@ -21,15 +28,32 @@ namespace keyboard {
// keyboard window.
class KEYBOARD_EXPORT KeyboardControllerProxy {
public:
- virtual ~KeyboardControllerProxy() {}
+ KeyboardControllerProxy();
+ virtual ~KeyboardControllerProxy();
- // Get the virtual keyboard window. Ownership of the returned Window remains
+ // Gets the virtual keyboard window. Ownership of the returned Window remains
// with the proxy.
- virtual aura::Window* GetKeyboardWindow() = 0;
+ virtual aura::Window* GetKeyboardWindow();
- // Get the InputMethod that will provide notifications about changes in the
+ // Gets the InputMethod that will provide notifications about changes in the
// text input context.
virtual ui::InputMethod* GetInputMethod() = 0;
+
+ protected:
+ // Gets the BrowserContext to use for creating the WebContents hosting the
+ // keyboard.
+ virtual content::BrowserContext* GetBrowserContext() = 0;
+
+ // The implementation can choose to setup the WebContents before the virtual
+ // keyboard page is loaded (e.g. install a WebContentsObserver).
+ // SetupWebContents() is called right after creating the WebContents, before
+ // loading the keyboard page.
+ virtual void SetupWebContents(content::WebContents* contents);
+
+ private:
+ scoped_ptr<content::WebContents> keyboard_contents_;
+
+ DISALLOW_COPY_AND_ASSIGN(KeyboardControllerProxy);
};
} // namespace keyboard