summaryrefslogtreecommitdiffstats
path: root/ui/keyboard/keyboard_controller_proxy.h
diff options
context:
space:
mode:
authorpkotwicz <pkotwicz@chromium.org>2014-11-18 16:07:36 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-19 00:07:53 +0000
commit8f7ebffc05e39acd69a92b33adacd289c895e269 (patch)
tree0a542fda4a3b9828c2b38c9d28f3ac81ecf08f90 /ui/keyboard/keyboard_controller_proxy.h
parent9bbc20b286a526d650a291419a8bc0c73b45dffe (diff)
downloadchromium_src-8f7ebffc05e39acd69a92b33adacd289c895e269.zip
chromium_src-8f7ebffc05e39acd69a92b33adacd289c895e269.tar.gz
chromium_src-8f7ebffc05e39acd69a92b33adacd289c895e269.tar.bz2
Componentize AshKeyboardControllerProxy part1
This CL makes KeyboardControllerProxy take in a BrowserContext in the constructor. A new KeyboardControllerProxy is created via ash::Shell::CreateKeyboard() when the BrowserContext changes BUG=431448 TEST=None Review URL: https://codereview.chromium.org/711843002 Cr-Commit-Position: refs/heads/master@{#304707}
Diffstat (limited to 'ui/keyboard/keyboard_controller_proxy.h')
-rw-r--r--ui/keyboard/keyboard_controller_proxy.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/keyboard/keyboard_controller_proxy.h b/ui/keyboard/keyboard_controller_proxy.h
index 86d95b4..2c91446 100644
--- a/ui/keyboard/keyboard_controller_proxy.h
+++ b/ui/keyboard/keyboard_controller_proxy.h
@@ -49,7 +49,7 @@ class KEYBOARD_EXPORT KeyboardControllerProxy : public aura::WindowObserver {
DISALLOW_COPY_AND_ASSIGN(TestApi);
};
- KeyboardControllerProxy();
+ explicit KeyboardControllerProxy(content::BrowserContext* context);
~KeyboardControllerProxy() override;
// Gets the virtual keyboard window. Ownership of the returned Window remains
@@ -102,10 +102,6 @@ class KEYBOARD_EXPORT KeyboardControllerProxy : public aura::WindowObserver {
virtual void ReloadKeyboardIfNeeded();
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
@@ -118,6 +114,8 @@ class KEYBOARD_EXPORT KeyboardControllerProxy : public aura::WindowObserver {
const gfx::Rect& new_bounds) override;
void OnWindowDestroyed(aura::Window* window) override;
+ content::BrowserContext* browser_context() { return browser_context_; }
+
private:
friend class TestApi;
@@ -127,6 +125,10 @@ class KEYBOARD_EXPORT KeyboardControllerProxy : public aura::WindowObserver {
// Gets the virtual keyboard URL (either the default URL or IME override URL).
const GURL& GetVirtualKeyboardUrl();
+ // The BrowserContext to use for creating the WebContents hosting the
+ // keyboard.
+ content::BrowserContext* browser_context_;
+
const GURL default_url_;
scoped_ptr<content::WebContents> keyboard_contents_;