OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 UI_KEYBOARD_CONTENT_KEYBOARD_UI_CONTENT_H_ | 5 #ifndef UI_KEYBOARD_CONTENT_KEYBOARD_UI_CONTENT_H_ |
6 #define UI_KEYBOARD_CONTENT_KEYBOARD_UI_CONTENT_H_ | 6 #define UI_KEYBOARD_CONTENT_KEYBOARD_UI_CONTENT_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "content/public/common/media_stream_request.h" | 9 #include "content/public/common/media_stream_request.h" |
10 #include "ui/aura/window_observer.h" | 10 #include "ui/aura/window_observer.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Loads system virtual keyboard. Noop if the current virtual keyboard is | 65 // Loads system virtual keyboard. Noop if the current virtual keyboard is |
66 // system virtual keyboard. | 66 // system virtual keyboard. |
67 virtual void LoadSystemKeyboard(); | 67 virtual void LoadSystemKeyboard(); |
68 | 68 |
69 // Called when a window being observed changes bounds, to update its insets. | 69 // Called when a window being observed changes bounds, to update its insets. |
70 void UpdateInsetsForWindow(aura::Window* window); | 70 void UpdateInsetsForWindow(aura::Window* window); |
71 | 71 |
72 // Overridden from KeyboardUI: | 72 // Overridden from KeyboardUI: |
73 aura::Window* GetKeyboardWindow() override; | 73 aura::Window* GetKeyboardWindow() override; |
74 bool HasKeyboardWindow() const override; | 74 bool HasKeyboardWindow() const override; |
| 75 bool ShouldWindowOverscroll(aura::Window* window) const override; |
75 void ReloadKeyboardIfNeeded() override; | 76 void ReloadKeyboardIfNeeded() override; |
76 void InitInsets(const gfx::Rect& new_bounds) override; | 77 void InitInsets(const gfx::Rect& new_bounds) override; |
77 void ResetInsets() override; | 78 void ResetInsets() override; |
78 | 79 |
79 protected: | 80 protected: |
80 // The implementation can choose to setup the WebContents before the virtual | 81 // The implementation can choose to setup the WebContents before the virtual |
81 // keyboard page is loaded (e.g. install a WebContentsObserver). | 82 // keyboard page is loaded (e.g. install a WebContentsObserver). |
82 // SetupWebContents() is called right after creating the WebContents, before | 83 // SetupWebContents() is called right after creating the WebContents, before |
83 // loading the keyboard page. | 84 // loading the keyboard page. |
84 virtual void SetupWebContents(content::WebContents* contents); | 85 virtual void SetupWebContents(content::WebContents* contents); |
85 | 86 |
86 // aura::WindowObserver overrides: | 87 // aura::WindowObserver overrides: |
87 void OnWindowBoundsChanged(aura::Window* window, | 88 void OnWindowBoundsChanged(aura::Window* window, |
88 const gfx::Rect& old_bounds, | 89 const gfx::Rect& old_bounds, |
89 const gfx::Rect& new_bounds) override; | 90 const gfx::Rect& new_bounds) override; |
90 void OnWindowDestroyed(aura::Window* window) override; | 91 void OnWindowDestroyed(aura::Window* window) override; |
91 | 92 |
92 content::BrowserContext* browser_context() { return browser_context_; } | 93 content::BrowserContext* browser_context() { return browser_context_; } |
93 | 94 |
| 95 const aura::Window* GetKeyboardRootWindow() const; |
| 96 |
94 private: | 97 private: |
95 friend class TestApi; | 98 friend class TestApi; |
96 | 99 |
97 // Loads the web contents for the given |url|. | 100 // Loads the web contents for the given |url|. |
98 void LoadContents(const GURL& url); | 101 void LoadContents(const GURL& url); |
99 | 102 |
100 // Gets the virtual keyboard URL (either the default URL or IME override URL). | 103 // Gets the virtual keyboard URL (either the default URL or IME override URL). |
101 const GURL& GetVirtualKeyboardUrl(); | 104 const GURL& GetVirtualKeyboardUrl(); |
102 | 105 |
103 // Determines whether a particular window should have insets for overscroll. | 106 // Determines whether a particular window should have insets for overscroll. |
(...skipping 13 matching lines...) Expand all Loading... |
117 scoped_ptr<content::WebContents> keyboard_contents_; | 120 scoped_ptr<content::WebContents> keyboard_contents_; |
118 scoped_ptr<wm::Shadow> shadow_; | 121 scoped_ptr<wm::Shadow> shadow_; |
119 | 122 |
120 scoped_ptr<WindowBoundsChangeObserver> window_bounds_observer_; | 123 scoped_ptr<WindowBoundsChangeObserver> window_bounds_observer_; |
121 | 124 |
122 DISALLOW_COPY_AND_ASSIGN(KeyboardUIContent); | 125 DISALLOW_COPY_AND_ASSIGN(KeyboardUIContent); |
123 }; | 126 }; |
124 | 127 |
125 } // namespace keyboard | 128 } // namespace keyboard |
126 | 129 |
127 #endif // UI_KEYBOARD_CONTENT_KEYBOARD_UI_CONTENT_H_ | 130 #endif // UI_KEYBOARD_CONTENT_KEYBOARD_UI_CONTENT_H_ |
OLD | NEW |