Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_KEYBOARD_CONTROLLER_PROXY_H_ | 5 #ifndef UI_KEYBOARD_KEYBOARD_CONTROLLER_PROXY_H_ |
| 6 #define UI_KEYBOARD_KEYBOARD_CONTROLLER_PROXY_H_ | 6 #define UI_KEYBOARD_KEYBOARD_CONTROLLER_PROXY_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/base/ime/text_input_type.h" | 10 #include "ui/base/ime/text_input_type.h" |
| 11 #include "ui/keyboard/keyboard_export.h" | 11 #include "ui/keyboard/keyboard_export.h" |
| 12 | 12 |
| 13 namespace aura { | 13 namespace aura { |
| 14 class Window; | 14 class Window; |
| 15 } | 15 } |
| 16 namespace content { | 16 namespace content { |
| 17 class BrowserContext; | 17 class BrowserContext; |
| 18 class SiteInstance; | 18 class SiteInstance; |
| 19 class WebContents; | 19 class WebContents; |
| 20 } | 20 } |
| 21 namespace gfx { | 21 namespace gfx { |
| 22 class Rect; | 22 class Rect; |
| 23 } | 23 } |
| 24 namespace ui { | 24 namespace ui { |
| 25 class InputMethod; | 25 class InputMethod; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace keyboard { | 28 namespace keyboard { |
| 29 | 29 |
| 30 class KeyboardResizer { | |
| 31 public: | |
| 32 virtual void SetKeyboardHeight(int height) = 0; | |
|
kevers
2013/11/29 20:26:05
Please document the method including units for the
Shu Chen
2013/12/02 03:54:40
I've refactored the changes and removed the keyboa
| |
| 33 }; | |
| 34 | |
| 30 // A proxy used by the KeyboardController to get access to the virtual | 35 // A proxy used by the KeyboardController to get access to the virtual |
| 31 // keyboard window. | 36 // keyboard window. |
| 32 class KEYBOARD_EXPORT KeyboardControllerProxy { | 37 class KEYBOARD_EXPORT KeyboardControllerProxy { |
| 33 public: | 38 public: |
| 34 KeyboardControllerProxy(); | 39 KeyboardControllerProxy(); |
| 35 virtual ~KeyboardControllerProxy(); | 40 virtual ~KeyboardControllerProxy(); |
| 36 | 41 |
| 37 // Gets the virtual keyboard window. Ownership of the returned Window remains | 42 // Gets the virtual keyboard window. Ownership of the returned Window remains |
| 38 // with the proxy. | 43 // with the proxy. |
| 39 virtual aura::Window* GetKeyboardWindow(); | 44 virtual aura::Window* GetKeyboardWindow(); |
| 40 | 45 |
| 41 // Sets the override content url. | 46 // Sets the override content url. |
| 42 void SetOverrideContentUrl(const GURL& url); | 47 void SetOverrideContentUrl(const GURL& url); |
| 43 | 48 |
| 49 // Sets the keyboard resizer. | |
| 50 void SetKeyboardResizer(KeyboardResizer* resizer); | |
| 51 | |
| 52 // Sets the keyboard height through the keyboard resizer. | |
| 53 void SetKeyboardHeight(int height); | |
| 54 | |
| 44 // Gets the InputMethod that will provide notifications about changes in the | 55 // Gets the InputMethod that will provide notifications about changes in the |
| 45 // text input context. | 56 // text input context. |
| 46 virtual ui::InputMethod* GetInputMethod() = 0; | 57 virtual ui::InputMethod* GetInputMethod() = 0; |
| 47 | 58 |
| 48 // Requests the audio input from microphone for speech input. | 59 // Requests the audio input from microphone for speech input. |
| 49 virtual void RequestAudioInput(content::WebContents* web_contents, | 60 virtual void RequestAudioInput(content::WebContents* web_contents, |
| 50 const content::MediaStreamRequest& request, | 61 const content::MediaStreamRequest& request, |
| 51 const content::MediaResponseCallback& callback) = 0; | 62 const content::MediaResponseCallback& callback) = 0; |
| 52 | 63 |
| 53 // Shows the container window of the keyboard. The default implementation | 64 // Shows the container window of the keyboard. The default implementation |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 79 private: | 90 private: |
| 80 // Reloads the web contents to the valid url from GetValidUrl(). | 91 // Reloads the web contents to the valid url from GetValidUrl(). |
| 81 void ReloadContents(); | 92 void ReloadContents(); |
| 82 | 93 |
| 83 // Gets the valid url from default url or override url. | 94 // Gets the valid url from default url or override url. |
| 84 const GURL& GetValidUrl(); | 95 const GURL& GetValidUrl(); |
| 85 | 96 |
| 86 const GURL default_url_; | 97 const GURL default_url_; |
| 87 GURL override_url_; | 98 GURL override_url_; |
| 88 | 99 |
| 100 KeyboardResizer* keyboard_resizer_; | |
| 101 | |
| 89 scoped_ptr<content::WebContents> keyboard_contents_; | 102 scoped_ptr<content::WebContents> keyboard_contents_; |
| 90 | 103 |
| 91 DISALLOW_COPY_AND_ASSIGN(KeyboardControllerProxy); | 104 DISALLOW_COPY_AND_ASSIGN(KeyboardControllerProxy); |
| 92 }; | 105 }; |
| 93 | 106 |
| 94 } // namespace keyboard | 107 } // namespace keyboard |
| 95 | 108 |
| 96 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_PROXY_H_ | 109 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_PROXY_H_ |
| OLD | NEW |