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

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

Issue 2445163002: Make aura work with mus (Closed)
Patch Set: NON_EXPORTED_BASE_CLASS 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
« no previous file with comments | « ui/aura/mus/window_tree_client_unittest.cc ('k') | ui/aura/mus/window_tree_host_mus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_
6 #define UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "services/service_manager/public/cpp/connector.h"
12 #include "ui/aura/aura_export.h"
13 #include "ui/aura/window_tree_host_platform.h"
14
15 class SkBitmap;
16
17 namespace service_manager {
18 class Connector;
19 }
20
21 namespace aura {
22
23 class InputMethodMus;
24 class WindowPortMus;
25
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.
32 //
33 // If a content window is supplied WindowTreeHostMus deletes itself when the
34 // content window is destroyed. If no content window is supplied it is assumed
35 // the WindowTreeHostMus is explicitly deleted.
36 class AURA_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform {
37 public:
38 explicit WindowTreeHostMus(std::unique_ptr<WindowPortMus> window_port,
39 Window* content_window = nullptr);
40 ~WindowTreeHostMus() override;
41
42 void CreateInputMethod(WindowPortMus* window_port_mus);
43
44 ui::EventDispatchDetails SendEventToProcessor(ui::Event* event) {
45 return aura::WindowTreeHostPlatform::SendEventToProcessor(event);
46 }
47
48 Window* content_window() { return content_window_; }
49
50 InputMethodMus* input_method() { return input_method_.get(); }
51
52 private:
53 class ContentWindowObserver;
54
55 // Called when various things happen to the content window.
56 void ContentWindowDestroyed();
57 void ContentWindowResized();
58 void ContentWindowVisibilityChanging(bool visible);
59
60 // aura::WindowTreeHostPlatform:
61 void DispatchEvent(ui::Event* event) override;
62 void OnClosed() override;
63 void OnActivationChanged(bool active) override;
64 void OnCloseRequest() override;
65 gfx::ICCProfile GetICCProfileForCurrentDisplay() override;
66
67 // May be null, see class description.
68 Window* content_window_;
69
70 std::unique_ptr<ContentWindowObserver> content_window_observer_;
71 std::unique_ptr<InputMethodMus> input_method_;
72
73 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMus);
74 };
75
76 } // namespace aura
77
78 #endif // UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_
OLDNEW
« no previous file with comments | « ui/aura/mus/window_tree_client_unittest.cc ('k') | ui/aura/mus/window_tree_host_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698