| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BASE_IME_INPUT_METHOD_BASE_H_ | 5 #ifndef UI_BASE_IME_INPUT_METHOD_BASE_H_ |
| 6 #define UI_BASE_IME_INPUT_METHOD_BASE_H_ | 6 #define UI_BASE_IME_INPUT_METHOD_BASE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // A helper class providing functionalities shared among ui::InputMethod | 25 // A helper class providing functionalities shared among ui::InputMethod |
| 26 // implementations. | 26 // implementations. |
| 27 class UI_BASE_EXPORT InputMethodBase | 27 class UI_BASE_EXPORT InputMethodBase |
| 28 : NON_EXPORTED_BASE(public InputMethod), | 28 : NON_EXPORTED_BASE(public InputMethod), |
| 29 public base::SupportsWeakPtr<InputMethodBase> { | 29 public base::SupportsWeakPtr<InputMethodBase> { |
| 30 public: | 30 public: |
| 31 InputMethodBase(); | 31 InputMethodBase(); |
| 32 virtual ~InputMethodBase(); | 32 virtual ~InputMethodBase(); |
| 33 | 33 |
| 34 // Overriden from InputMethod. | 34 // Overriden from InputMethod. |
| 35 virtual void SetDelegate(internal::InputMethodDelegate* delegate) OVERRIDE; | 35 virtual void SetDelegate(internal::InputMethodDelegate* delegate) override; |
| 36 virtual void Init(bool focused) OVERRIDE; | 36 virtual void Init(bool focused) override; |
| 37 // If a derived class overrides OnFocus()/OnBlur(), it should call parent's | 37 // If a derived class overrides OnFocus()/OnBlur(), it should call parent's |
| 38 // implementation first, to make sure |system_toplevel_window_focused_| flag | 38 // implementation first, to make sure |system_toplevel_window_focused_| flag |
| 39 // can be updated correctly. | 39 // can be updated correctly. |
| 40 virtual void OnFocus() OVERRIDE; | 40 virtual void OnFocus() override; |
| 41 virtual void OnBlur() OVERRIDE; | 41 virtual void OnBlur() override; |
| 42 virtual void SetFocusedTextInputClient(TextInputClient* client) OVERRIDE; | 42 virtual void SetFocusedTextInputClient(TextInputClient* client) override; |
| 43 virtual void DetachTextInputClient(TextInputClient* client) OVERRIDE; | 43 virtual void DetachTextInputClient(TextInputClient* client) override; |
| 44 virtual TextInputClient* GetTextInputClient() const OVERRIDE; | 44 virtual TextInputClient* GetTextInputClient() const override; |
| 45 | 45 |
| 46 // If a derived class overrides this method, it should call parent's | 46 // If a derived class overrides this method, it should call parent's |
| 47 // implementation. | 47 // implementation. |
| 48 virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE; | 48 virtual void OnTextInputTypeChanged(const TextInputClient* client) override; |
| 49 | 49 |
| 50 virtual TextInputType GetTextInputType() const OVERRIDE; | 50 virtual TextInputType GetTextInputType() const override; |
| 51 virtual TextInputMode GetTextInputMode() const OVERRIDE; | 51 virtual TextInputMode GetTextInputMode() const override; |
| 52 virtual bool CanComposeInline() const OVERRIDE; | 52 virtual bool CanComposeInline() const override; |
| 53 virtual void ShowImeIfNeeded() OVERRIDE; | 53 virtual void ShowImeIfNeeded() override; |
| 54 | 54 |
| 55 virtual void AddObserver(InputMethodObserver* observer) OVERRIDE; | 55 virtual void AddObserver(InputMethodObserver* observer) override; |
| 56 virtual void RemoveObserver(InputMethodObserver* observer) OVERRIDE; | 56 virtual void RemoveObserver(InputMethodObserver* observer) override; |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 virtual void OnWillChangeFocusedClient(TextInputClient* focused_before, | 59 virtual void OnWillChangeFocusedClient(TextInputClient* focused_before, |
| 60 TextInputClient* focused) {} | 60 TextInputClient* focused) {} |
| 61 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before, | 61 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before, |
| 62 TextInputClient* focused) {} | 62 TextInputClient* focused) {} |
| 63 | 63 |
| 64 // Returns true if |client| is currently focused. | 64 // Returns true if |client| is currently focused. |
| 65 bool IsTextInputClientFocused(const TextInputClient* client); | 65 bool IsTextInputClientFocused(const TextInputClient* client); |
| 66 | 66 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 ObserverList<InputMethodObserver> observer_list_; | 108 ObserverList<InputMethodObserver> observer_list_; |
| 109 | 109 |
| 110 bool system_toplevel_window_focused_; | 110 bool system_toplevel_window_focused_; |
| 111 | 111 |
| 112 DISALLOW_COPY_AND_ASSIGN(InputMethodBase); | 112 DISALLOW_COPY_AND_ASSIGN(InputMethodBase); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 } // namespace ui | 115 } // namespace ui |
| 116 | 116 |
| 117 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_ | 117 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_ |
| OLD | NEW |