Chromium Code Reviews| Index: ui/aura/mus/window_tree_host_mus.h |
| diff --git a/ui/views/mus/window_tree_host_mus.h b/ui/aura/mus/window_tree_host_mus.h |
| similarity index 31% |
| copy from ui/views/mus/window_tree_host_mus.h |
| copy to ui/aura/mus/window_tree_host_mus.h |
| index 84c4649e85265b581ab6e629a20fc7d179514358..e312b2ce66b4ec124e290be8939a1b7a8338996c 100644 |
| --- a/ui/views/mus/window_tree_host_mus.h |
| +++ b/ui/aura/mus/window_tree_host_mus.h |
| @@ -2,36 +2,57 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef UI_VIEWS_MUS_WINDOW_TREE_HOST_MUS_H_ |
| -#define UI_VIEWS_MUS_WINDOW_TREE_HOST_MUS_H_ |
| +#ifndef UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ |
| +#define UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ |
| + |
| +#include <memory> |
| #include "base/macros.h" |
| #include "services/service_manager/public/cpp/connector.h" |
| +#include "ui/aura/aura_export.h" |
| #include "ui/aura/window_tree_host_platform.h" |
| -#include "ui/views/mus/mus_export.h" |
| class SkBitmap; |
| -namespace ui { |
| -class Window; |
| -} |
| - |
| namespace service_manager { |
| class Connector; |
| } |
| -namespace views { |
| +namespace aura { |
| -class NativeWidgetMus; |
| -class PlatformWindowMus; |
| +class InputMethodMus; |
| +class WindowPortMus; |
| -class VIEWS_MUS_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform { |
| +// WindowTreeHostMus is configured in two distinct modes: |
| +// . with a content window. In this case the content window is added as a child |
| +// of the Window created by this class. Any changes to the size of the content |
| +// window is propagated to its parent. Additionally once the content window is |
| +// destroyed the WindowTreeHostMus is destroyed. |
| +// . without a content window. |
|
sadrul
2016/10/26 18:38:20
Who is the owner of WTHMus? especially when there
sky
2016/10/26 19:56:45
Good question. I added this:
// If a content wind
|
| +class AURA_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform { |
| public: |
| - WindowTreeHostMus(NativeWidgetMus* native_widget, ui::Window* window); |
| + explicit WindowTreeHostMus(std::unique_ptr<WindowPortMus> window_port, |
| + Window* content_window = nullptr); |
| ~WindowTreeHostMus() override; |
| - NativeWidgetMus* native_widget() { return native_widget_; } |
| + |
| + void CreateInputMethod(WindowPortMus* window_port_mus); |
| + |
| + ui::EventDispatchDetails SendEventToProcessor(ui::Event* event) { |
| + return aura::WindowTreeHostPlatform::SendEventToProcessor(event); |
| + } |
| + |
| + Window* content_window() { return content_window_; } |
| + |
| + InputMethodMus* input_method() { return input_method_.get(); } |
| private: |
| + class ContentWindowObserver; |
| + |
| + // Called when various things happen to the content window. |
| + void ContentWindowDestroyed(); |
| + void ContentWindowResized(); |
| + void ContentWindowVisibilityChanging(bool visible); |
| + |
| // aura::WindowTreeHostPlatform: |
| void DispatchEvent(ui::Event* event) override; |
| void OnClosed() override; |
| @@ -39,11 +60,15 @@ class VIEWS_MUS_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform { |
| void OnCloseRequest() override; |
| gfx::ICCProfile GetICCProfileForCurrentDisplay() override; |
| - NativeWidgetMus* native_widget_; |
| + // May be null, see class description. |
| + Window* content_window_; |
| + |
| + std::unique_ptr<ContentWindowObserver> content_window_observer_; |
| + std::unique_ptr<InputMethodMus> input_method_; |
| DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMus); |
| }; |
| -} // namespace views |
| +} // namespace aura |
| -#endif // UI_VIEWS_MUS_WINDOW_TREE_HOST_MUS_H_ |
| +#endif // UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ |