Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(721)

Unified Diff: ui/base/ime/win/tsf_event_router.h

Issue 11305002: Support TSF related event handling on NativeTextField (Closed) Base URL: http://git.chromium.org/chromium/src.git@findbar_fix
Patch Set: Address comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_win.cc ('k') | ui/base/ime/win/tsf_event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/win/tsf_event_router.h
diff --git a/ui/base/ime/win/tsf_event_router.h b/ui/base/ime/win/tsf_event_router.h
index e16df27d5e15fe47788ba9c60ed941695738c385..4d9128d79fecd82537642c4bf4b6bf2f81056bd3 100644
--- a/ui/base/ime/win/tsf_event_router.h
+++ b/ui/base/ime/win/tsf_event_router.h
@@ -15,6 +15,7 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "ui/base/ime/text_input_type.h"
+#include "ui/base/range/range.h"
#include "ui/base/ui_export.h"
struct ITfDocumentMgr;
@@ -25,11 +26,18 @@ class TsfEventRouterObserver {
public:
TsfEventRouterObserver() {}
- // Called when the text contents are updated.
- virtual void OnTextUpdated() = 0;
-
// Called when the number of currently opened candidate windows changes.
- virtual void OnCandidateWindowCountChanged(size_t window_count) = 0;
+ virtual void OnCandidateWindowCountChanged(size_t window_count) {}
+
+ // Called when a composition is started.
+ virtual void OnTsfStartComposition() {}
+
+ // Called when the text contents are updated. If there is no composition,
+ // ui::Range::InvalidRange is passed to |composition_range|.
+ virtual void OnTextUpdated(const ui::Range& composition_range) {}
+
+ // Called when a composition is terminated.
+ virtual void OnTsfEndComposition() {}
protected:
virtual ~TsfEventRouterObserver() {}
@@ -46,15 +54,17 @@ class UI_EXPORT TsfEventRouter {
explicit TsfEventRouter(TsfEventRouterObserver* observer);
virtual ~TsfEventRouter();
- // Sets |thread_manager| to be monitored. |thread_manager| can be NULL.
- void SetManager(ITfThreadMgr* thread_manager);
-
// Returns true if the IME is composing text.
bool IsImeComposing();
// Callbacks from the TsfEventRouterDelegate:
- void OnTextUpdated();
void OnCandidateWindowCountChanged(size_t window_count);
+ void OnTsfStartComposition();
+ void OnTextUpdated(const ui::Range& composition_range);
+ void OnTsfEndComposition();
+
+ // Sets |thread_manager| to be monitored. |thread_manager| can be NULL.
+ void SetManager(ITfThreadMgr* thread_manager);
private:
class TsfEventRouterDelegate;
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_win.cc ('k') | ui/base/ime/win/tsf_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698