Index: mojo/aura/window_tree_host_mojo.h |
diff --git a/mojo/examples/aura_demo/window_tree_host_view_manager.h b/mojo/aura/window_tree_host_mojo.h |
similarity index 69% |
rename from mojo/examples/aura_demo/window_tree_host_view_manager.h |
rename to mojo/aura/window_tree_host_mojo.h |
index f22cdb61c89e7dc85678df7397492b972b997b61..fe5ca77544d85e4aa1d26712fe41049979ef32b4 100644 |
--- a/mojo/examples/aura_demo/window_tree_host_view_manager.h |
+++ b/mojo/aura/window_tree_host_mojo.h |
@@ -9,17 +9,31 @@ |
#include "ui/events/event_source.h" |
#include "ui/gfx/geometry/rect.h" |
+class SkBitmap; |
+ |
+namespace ui { |
+class Compositor; |
+} |
+ |
namespace mojo { |
-namespace examples { |
-class WindowTreeHostViewManager : public aura::WindowTreeHost, |
- public ui::EventSource { |
+class WindowTreeHostMojoDelegate; |
+ |
+class WindowTreeHostMojo : public aura::WindowTreeHost, public ui::EventSource { |
public: |
- explicit WindowTreeHostViewManager(const gfx::Rect& bounds); |
- virtual ~WindowTreeHostViewManager(); |
+ WindowTreeHostMojo(const gfx::Rect& bounds, |
+ WindowTreeHostMojoDelegate* delegate); |
+ virtual ~WindowTreeHostMojo(); |
+ |
+ // Returns the WindowTreeHostMojo for the specified compositor. |
+ static WindowTreeHostMojo* ForCompositor(ui::Compositor* compositor); |
const gfx::Rect& bounds() const { return bounds_; } |
+ // Sets the contents to show in this WindowTreeHost. This forwards to the |
+ // delegate. |
+ void SetContents(const SkBitmap& contents); |
+ |
private: |
// WindowTreeHost: |
virtual ui::EventSource* GetEventSource() OVERRIDE; |
@@ -42,10 +56,11 @@ class WindowTreeHostViewManager : public aura::WindowTreeHost, |
gfx::Rect bounds_; |
- DISALLOW_COPY_AND_ASSIGN(WindowTreeHostViewManager); |
+ WindowTreeHostMojoDelegate* delegate_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMojo); |
}; |
-} // namespace examples |
} // namespace mojo |
#endif // MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_VIEW_MANAGER_H_ |