Chromium Code Reviews| 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 <unordered_set> | |
| 9 | 10 |
| 10 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 12 #include "content/common/text_input_state.h" | 13 #include "content/common/text_input_state.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 class RenderWidgetHostView; | 17 class RenderWidgetHostView; |
| 17 class RenderWidgetHostViewBase; | 18 class RenderWidgetHostViewBase; |
| 18 class WebContents; | 19 class WebContents; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 // Only the tab's RWHV should observer TextInputManager. In tests, however, | 75 // Only the tab's RWHV should observer TextInputManager. In tests, however, |
| 75 // in addition to the tab's RWHV, one or more test observers might observe | 76 // in addition to the tab's RWHV, one or more test observers might observe |
| 76 // TextInputManager. | 77 // TextInputManager. |
| 77 void AddObserver(Observer* observer); | 78 void AddObserver(Observer* observer); |
| 78 void RemoveObserver(Observer* observer); | 79 void RemoveObserver(Observer* observer); |
| 79 | 80 |
| 80 private: | 81 private: |
| 81 friend bool GetTextInputTypeForView(WebContents* web_contents, | 82 friend bool GetTextInputTypeForView(WebContents* web_contents, |
| 82 RenderWidgetHostView* view, | 83 RenderWidgetHostView* view, |
| 83 ui::TextInputType* type); | 84 ui::TextInputType* type); |
| 85 friend std::unordered_set<RenderWidgetHostView*> | |
| 86 GetAllViewsRegisteredWithTextInputManager(WebContents* web_contents); | |
|
Charlie Reis
2016/06/13 18:46:13
I'm not thrilled with having lots of raw test meth
EhsanK
2016/06/25 00:10:35
Apparently I had miss(e|understoo)d that comment.
Charlie Reis
2016/06/28 18:12:41
I like how patch set 5 has two limited testing met
| |
| 84 | 87 |
| 85 void NotifyObserversAboutInputStateUpdate(RenderWidgetHostViewBase* view, | 88 void NotifyObserversAboutInputStateUpdate(RenderWidgetHostViewBase* view, |
| 86 bool did_update_state); | 89 bool did_update_state); |
| 87 | 90 |
| 88 // The view with active text input state. | 91 // The view with active text input state. |
| 89 RenderWidgetHostViewBase* active_view_; | 92 RenderWidgetHostViewBase* active_view_; |
| 90 | 93 |
| 91 std::unordered_map<RenderWidgetHostViewBase*, TextInputState> | 94 std::unordered_map<RenderWidgetHostViewBase*, TextInputState> |
| 92 text_input_state_map_; | 95 text_input_state_map_; |
| 93 | 96 |
| 94 base::ObserverList<Observer> observer_list_; | 97 base::ObserverList<Observer> observer_list_; |
| 95 | 98 |
| 96 DISALLOW_COPY_AND_ASSIGN(TextInputManager); | 99 DISALLOW_COPY_AND_ASSIGN(TextInputManager); |
| 97 }; | 100 }; |
| 98 } | 101 } |
| 99 | 102 |
| 100 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ | 103 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ |
| OLD | NEW |