| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ | 6 #define CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ |
| 7 | 7 |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // --------------------------------------------------------------------------- | 70 // --------------------------------------------------------------------------- |
| 71 // The following methods can be used to obtain information about IME-related | 71 // The following methods can be used to obtain information about IME-related |
| 72 // state for the active RenderWidgetHost. If the active widget is nullptr, the | 72 // state for the active RenderWidgetHost. If the active widget is nullptr, the |
| 73 // methods below will return nullptr as well. | 73 // methods below will return nullptr as well. |
| 74 // Users of these methods should not hold on to the pointers as they become | 74 // Users of these methods should not hold on to the pointers as they become |
| 75 // dangling if the TextInputManager or |active_view_| are destroyed. | 75 // dangling if the TextInputManager or |active_view_| are destroyed. |
| 76 | 76 |
| 77 // Returns the currently stored TextInputState. An state of nullptr can be | 77 // Returns the currently stored TextInputState. An state of nullptr can be |
| 78 // interpreted as a ui::TextInputType of ui::TEXT_INPUT_TYPE_NONE. | 78 // interpreted as a ui::TextInputType of ui::TEXT_INPUT_TYPE_NONE. |
| 79 const TextInputState* GetTextInputState(); | 79 const TextInputState* GetTextInputState() const; |
| 80 | 80 |
| 81 // Returns the rect between selection bounds. | 81 // Returns the rect between selection bounds. |
| 82 gfx::Rect GetSelectionBoundsRect(); | 82 gfx::Rect GetSelectionBoundsRect() const; |
| 83 | 83 |
| 84 // Returns a vector of rects representing the character bounds. | 84 // Returns a vector of rects representing the character bounds. |
| 85 const std::vector<gfx::Rect>* GetCompositionCharacterBounds(); | 85 const std::vector<gfx::Rect>* GetCompositionCharacterBounds() const; |
| 86 | 86 |
| 87 // --------------------------------------------------------------------------- | 87 // --------------------------------------------------------------------------- |
| 88 // The following methods are called by RWHVs on the tab to update their IME- | 88 // The following methods are called by RWHVs on the tab to update their IME- |
| 89 // related state. | 89 // related state. |
| 90 | 90 |
| 91 // Updates the TextInputState for |view|. | 91 // Updates the TextInputState for |view|. |
| 92 void UpdateTextInputState(RenderWidgetHostViewBase* view, | 92 void UpdateTextInputState(RenderWidgetHostViewBase* view, |
| 93 const TextInputState& state); | 93 const TextInputState& state); |
| 94 | 94 |
| 95 // The current IME composition has been cancelled on the renderer side for | 95 // The current IME composition has been cancelled on the renderer side for |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 ViewMap<SelectionRegion> selection_region_map_; | 177 ViewMap<SelectionRegion> selection_region_map_; |
| 178 ViewMap<CompositionRangeInfo> composition_range_info_map_; | 178 ViewMap<CompositionRangeInfo> composition_range_info_map_; |
| 179 | 179 |
| 180 base::ObserverList<Observer> observer_list_; | 180 base::ObserverList<Observer> observer_list_; |
| 181 | 181 |
| 182 DISALLOW_COPY_AND_ASSIGN(TextInputManager); | 182 DISALLOW_COPY_AND_ASSIGN(TextInputManager); |
| 183 }; | 183 }; |
| 184 } | 184 } |
| 185 | 185 |
| 186 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ | 186 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ |
| OLD | NEW |