Commit 92649ee2 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Prepare mus_demo for external window mode some more

This CL brings no functionality changes, to makes the CL [1]
that will bring external window mode capabilities to Mus slightly
smaller.

In summary it:

- removes a loose include in mus_demo_external.h
- adds a setter for the WindowTreeHostMus in WindowTreeData class,
  as a protected member (to be used by WindowTreeDataExternal in [1])
  and uses it.
- Conditions WindowTreeData::IsInitialized to 'window_delegate_' rather
  than to 'window_tree_host_'. Reason: after [1], window_tree_host_ will
  be initialized earlier on, and not reflect a WindowTreeData instance
  actually be initialized anymore.

BUG=666958

[1] https://crrev.com/c/955782

Change-Id: Ifec202d2217cfeafd9a13c7811610fbe450b9937
Reviewed-on: https://chromium-review.googlesource.com/957143Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#542145}
parent 489b507f
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <vector> #include <vector>
#include "services/ui/demo/mus_demo.h" #include "services/ui/demo/mus_demo.h"
#include "services/ui/public/interfaces/window_tree_host_factory.mojom.h"
namespace ui { namespace ui {
namespace demo { namespace demo {
......
...@@ -70,7 +70,7 @@ void WindowTreeData::Init( ...@@ -70,7 +70,7 @@ void WindowTreeData::Init(
std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) { std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) {
window_tree_host->Show(); window_tree_host->Show();
// Take ownership of the WTH. // Take ownership of the WTH.
window_tree_host_ = std::move(window_tree_host); SetWindowTreeHost(std::move(window_tree_host));
// Initialize the window for the bitmap. // Initialize the window for the bitmap.
window_delegate_ = new aura_extra::ImageWindowDelegate(); window_delegate_ = new aura_extra::ImageWindowDelegate();
......
...@@ -27,12 +27,18 @@ class WindowTreeData { ...@@ -27,12 +27,18 @@ class WindowTreeData {
// Initializes the window tree host and start drawing frames. // Initializes the window tree host and start drawing frames.
void Init(std::unique_ptr<aura::WindowTreeHostMus> window_tree_host); void Init(std::unique_ptr<aura::WindowTreeHostMus> window_tree_host);
bool IsInitialized() const { return !!window_tree_host_; } bool IsInitialized() const { return !!window_delegate_; }
const aura::WindowTreeHostMus* WindowTreeHost() const { const aura::WindowTreeHostMus* WindowTreeHost() const {
return window_tree_host_.get(); return window_tree_host_.get();
} }
protected:
void SetWindowTreeHost(
std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) {
window_tree_host_ = std::move(window_tree_host);
}
private: private:
// Draws one frame, incrementing the rotation angle. // Draws one frame, incrementing the rotation angle.
void DrawFrame(); void DrawFrame();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment