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" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 // Hides the container window of the keyboard. The default implementation | 58 // Hides the container window of the keyboard. The default implementation |
| 59 // simply hides the container. An overridden implementation can set up | 59 // simply hides the container. An overridden implementation can set up |
| 60 // necesasry animation, or delay the visibility change as it desires. | 60 // necesasry animation, or delay the visibility change as it desires. |
| 61 virtual void HideKeyboardContainer(aura::Window* container); | 61 virtual void HideKeyboardContainer(aura::Window* container); |
| 62 | 62 |
| 63 // Updates the type of the focused text input box. The default implementation | 63 // Updates the type of the focused text input box. The default implementation |
| 64 // calls OnTextInputBoxFocused javascript function through webui to update the | 64 // calls OnTextInputBoxFocused javascript function through webui to update the |
| 65 // type the of focused input box. | 65 // type the of focused input box. |
| 66 virtual void SetUpdateInputType(ui::TextInputType type); | 66 virtual void SetUpdateInputType(ui::TextInputType type); |
| 67 | 67 |
| 68 // The current keyboard content window's height in logical pixels. | |
| 69 static int keyboard_height; | |
|
kevers
2013/12/03 00:08:12
Please avoid using public static data members. Ke
Shu Chen
2013/12/03 01:54:42
Done.
| |
| 70 | |
| 71 // Whether the current keyboard window is resizing. This is used in keyboard | |
| 72 // contents delegate's MoveContents(). | |
| 73 static bool keyboard_resizing_from_contents; | |
| 74 | |
| 68 protected: | 75 protected: |
| 69 // Gets the BrowserContext to use for creating the WebContents hosting the | 76 // Gets the BrowserContext to use for creating the WebContents hosting the |
| 70 // keyboard. | 77 // keyboard. |
| 71 virtual content::BrowserContext* GetBrowserContext() = 0; | 78 virtual content::BrowserContext* GetBrowserContext() = 0; |
| 72 | 79 |
| 73 // The implementation can choose to setup the WebContents before the virtual | 80 // The implementation can choose to setup the WebContents before the virtual |
| 74 // keyboard page is loaded (e.g. install a WebContentsObserver). | 81 // keyboard page is loaded (e.g. install a WebContentsObserver). |
| 75 // SetupWebContents() is called right after creating the WebContents, before | 82 // SetupWebContents() is called right after creating the WebContents, before |
| 76 // loading the keyboard page. | 83 // loading the keyboard page. |
| 77 virtual void SetupWebContents(content::WebContents* contents); | 84 virtual void SetupWebContents(content::WebContents* contents); |
| 78 | 85 |
| 79 private: | 86 private: |
| 80 // Reloads the web contents to the valid url from GetValidUrl(). | 87 // Reloads the web contents to the valid url from GetValidUrl(). |
| 81 void ReloadContents(); | 88 void ReloadContents(); |
| 82 | 89 |
| 83 // Gets the valid url from default url or override url. | 90 // Gets the valid url from default url or override url. |
| 84 const GURL& GetValidUrl(); | 91 const GURL& GetValidUrl(); |
| 85 | 92 |
| 86 const GURL default_url_; | 93 const GURL default_url_; |
| 87 GURL override_url_; | 94 GURL override_url_; |
| 88 | 95 |
| 89 scoped_ptr<content::WebContents> keyboard_contents_; | 96 scoped_ptr<content::WebContents> keyboard_contents_; |
| 90 | 97 |
| 91 DISALLOW_COPY_AND_ASSIGN(KeyboardControllerProxy); | 98 DISALLOW_COPY_AND_ASSIGN(KeyboardControllerProxy); |
| 92 }; | 99 }; |
| 93 | 100 |
| 94 } // namespace keyboard | 101 } // namespace keyboard |
| 95 | 102 |
| 96 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_PROXY_H_ | 103 #endif // UI_KEYBOARD_KEYBOARD_CONTROLLER_PROXY_H_ |
| OLD | NEW |