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

Side by Side Diff: ui/aura/mus/window_tree_host_mus.h

Issue 2445163002: Make aura work with mus (Closed)
Patch Set: split out Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_MUS_WINDOW_TREE_HOST_MUS_H_ 5 #ifndef UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_
6 #define UI_VIEWS_MUS_WINDOW_TREE_HOST_MUS_H_ 6 #define UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_
7
8 #include <memory>
7 9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "services/service_manager/public/cpp/connector.h" 11 #include "services/service_manager/public/cpp/connector.h"
12 #include "ui/aura/aura_export.h"
10 #include "ui/aura/window_tree_host_platform.h" 13 #include "ui/aura/window_tree_host_platform.h"
11 #include "ui/views/mus/mus_export.h"
12 14
13 class SkBitmap; 15 class SkBitmap;
14 16
15 namespace ui {
16 class Window;
17 }
18
19 namespace service_manager { 17 namespace service_manager {
20 class Connector; 18 class Connector;
21 } 19 }
22 20
23 namespace views { 21 namespace aura {
24 22
25 class NativeWidgetMus; 23 class InputMethodMus;
26 class PlatformWindowMus; 24 class WindowPortMus;
27 25
28 class VIEWS_MUS_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform { 26 // WindowTreeHostMus is configured in two distinct modes:
27 // . with a content window. In this case the content window is added as a child
28 // of the Window created by this class. Any changes to the size of the content
29 // window is propagated to its parent. Additionally once the content window is
30 // destroyed the WindowTreeHostMus is destroyed.
31 // . 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
32 class AURA_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform {
29 public: 33 public:
30 WindowTreeHostMus(NativeWidgetMus* native_widget, ui::Window* window); 34 explicit WindowTreeHostMus(std::unique_ptr<WindowPortMus> window_port,
35 Window* content_window = nullptr);
31 ~WindowTreeHostMus() override; 36 ~WindowTreeHostMus() override;
32 NativeWidgetMus* native_widget() { return native_widget_; } 37
38 void CreateInputMethod(WindowPortMus* window_port_mus);
39
40 ui::EventDispatchDetails SendEventToProcessor(ui::Event* event) {
41 return aura::WindowTreeHostPlatform::SendEventToProcessor(event);
42 }
43
44 Window* content_window() { return content_window_; }
45
46 InputMethodMus* input_method() { return input_method_.get(); }
33 47
34 private: 48 private:
49 class ContentWindowObserver;
50
51 // Called when various things happen to the content window.
52 void ContentWindowDestroyed();
53 void ContentWindowResized();
54 void ContentWindowVisibilityChanging(bool visible);
55
35 // aura::WindowTreeHostPlatform: 56 // aura::WindowTreeHostPlatform:
36 void DispatchEvent(ui::Event* event) override; 57 void DispatchEvent(ui::Event* event) override;
37 void OnClosed() override; 58 void OnClosed() override;
38 void OnActivationChanged(bool active) override; 59 void OnActivationChanged(bool active) override;
39 void OnCloseRequest() override; 60 void OnCloseRequest() override;
40 gfx::ICCProfile GetICCProfileForCurrentDisplay() override; 61 gfx::ICCProfile GetICCProfileForCurrentDisplay() override;
41 62
42 NativeWidgetMus* native_widget_; 63 // May be null, see class description.
64 Window* content_window_;
65
66 std::unique_ptr<ContentWindowObserver> content_window_observer_;
67 std::unique_ptr<InputMethodMus> input_method_;
43 68
44 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMus); 69 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMus);
45 }; 70 };
46 71
47 } // namespace views 72 } // namespace aura
48 73
49 #endif // UI_VIEWS_MUS_WINDOW_TREE_HOST_MUS_H_ 74 #endif // UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698