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

Unified Diff: ui/aura/window_tree_host.h

Issue 1155013005: Refactoring the ownership of ui::InputMethod. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pls be green! Created 5 years, 7 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
Index: ui/aura/window_tree_host.h
diff --git a/ui/aura/window_tree_host.h b/ui/aura/window_tree_host.h
index 0d09093bca14112928d511225b89288b22dd973c..44c1b05b684001fc1f4aab87efb99c1809e855a5 100644
--- a/ui/aura/window_tree_host.h
+++ b/ui/aura/window_tree_host.h
@@ -11,6 +11,8 @@
#include "base/message_loop/message_loop.h"
#include "ui/aura/aura_export.h"
#include "ui/base/cursor/cursor.h"
+#include "ui/base/ime/input_method.h"
James Cook 2015/06/01 22:21:00 optional: you could forward-declare ui::InputMetho
Shu Chen 2015/06/02 04:11:16 Done.
+#include "ui/base/ime/input_method_delegate.h"
#include "ui/events/event_source.h"
#include "ui/gfx/native_widget_types.h"
@@ -39,9 +41,11 @@ class WindowTreeHostObserver;
// WindowTreeHost bridges between a native window and the embedded RootWindow.
// It provides the accelerated widget and maps events from the native os to
// aura.
-class AURA_EXPORT WindowTreeHost {
+class AURA_EXPORT WindowTreeHost
+ : public ui::internal::InputMethodDelegate,
+ public ui::EventSource {
public:
- virtual ~WindowTreeHost();
+ ~WindowTreeHost() override;
// Creates a new WindowTreeHost. The caller owns the returned value.
static WindowTreeHost* Create(const gfx::Rect& bounds);
@@ -116,6 +120,10 @@ class AURA_EXPORT WindowTreeHost {
gfx::NativeCursor last_cursor() const { return last_cursor_; }
+ ui::InputMethod* GetInputMethod();
+
+ void SetInputMethod(ui::InputMethod* input_method);
James Cook 2015/06/01 22:21:00 Document how this behaves with respect to ownershi
Shu Chen 2015/06/02 04:11:16 Done.
+
// Returns the EventSource responsible for dispatching events to the window
// tree.
virtual ui::EventSource* GetEventSource() = 0;
@@ -166,6 +174,13 @@ class AURA_EXPORT WindowTreeHost {
// kCalled when the cursor visibility has changed.
virtual void OnCursorVisibilityChangedNative(bool show) = 0;
+ // Overridden from ui::internal::InputMethodDelegate:
+ bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override;
+
+ // Overridden from ui::EventSource:
+ ui::EventProcessor* GetEventProcessor() override;
+ ui::EventDispatchDetails DeliverEventToProcessor(ui::Event* event) override;
+
private:
friend class test::WindowTreeHostTestApi;
@@ -192,6 +207,9 @@ class AURA_EXPORT WindowTreeHost {
scoped_ptr<ui::ViewProp> prop_;
+ ui::InputMethod* input_method_;
James Cook 2015/06/01 22:21:00 Document how ownership works for this member.
Shu Chen 2015/06/02 04:11:16 Done.
+ bool owned_input_method_;
+
DISALLOW_COPY_AND_ASSIGN(WindowTreeHost);
};

Powered by Google App Engine
This is Rietveld 408576698