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

Side by Side Diff: ui/views/mus/mus_client.h

Issue 2655513002: mash: Relay some Chrome aura window properties to Ash. (Closed)
Patch Set: cleanup. Created 3 years, 10 months 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_MUS_CLIENT_H_ 5 #ifndef UI_VIEWS_MUS_MUS_CLIENT_H_
6 #define UI_VIEWS_MUS_MUS_CLIENT_H_ 6 #define UI_VIEWS_MUS_MUS_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "ui/aura/mus/window_tree_client_delegate.h" 15 #include "ui/aura/mus/window_tree_client_delegate.h"
16 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h" 16 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h"
17 #include "ui/views/mus/mus_export.h" 17 #include "ui/views/mus/mus_export.h"
18 #include "ui/views/mus/mus_property_mirror.h"
sky 2017/01/27 20:10:45 Forward declare?
msw 2017/01/27 21:19:25 Done.
18 #include "ui/views/mus/screen_mus_delegate.h" 19 #include "ui/views/mus/screen_mus_delegate.h"
19 #include "ui/views/widget/widget.h" 20 #include "ui/views/widget/widget.h"
20 21
21 namespace aura { 22 namespace aura {
22 class PropertyConverter; 23 class PropertyConverter;
23 class Window; 24 class Window;
24 class WindowTreeClient; 25 class WindowTreeClient;
25 } 26 }
26 27
27 namespace base { 28 namespace base {
(...skipping 23 matching lines...) Expand all
51 namespace internal { 52 namespace internal {
52 class NativeWidgetDelegate; 53 class NativeWidgetDelegate;
53 } 54 }
54 55
55 namespace test { 56 namespace test {
56 class MusClientTestApi; 57 class MusClientTestApi;
57 } 58 }
58 59
59 // MusClient establishes a connection to mus and sets up necessary state so that 60 // MusClient establishes a connection to mus and sets up necessary state so that
60 // aura and views target mus. This class is useful for typical clients, not the 61 // aura and views target mus. This class is useful for typical clients, not the
61 // WindowManager. Most clients don't create this directly, rather use 62 // WindowManager. Most clients don't create this directly, rather use AuraInit.
62 // AuraInit.
63 class VIEWS_MUS_EXPORT MusClient 63 class VIEWS_MUS_EXPORT MusClient
64 : public aura::WindowTreeClientDelegate, 64 : public aura::WindowTreeClientDelegate,
65 public ScreenMusDelegate, 65 public ScreenMusDelegate,
66 public ui::OSExchangeDataProviderFactory::Factory { 66 public ui::OSExchangeDataProviderFactory::Factory {
67 public: 67 public:
68 // Most clients should use AuraInit, which creates a MusClient. 68 // Most clients should use AuraInit, which creates a MusClient.
69 // |create_wm_state| indicates whether MusClient should create a wm::WMState. 69 // |create_wm_state| indicates whether MusClient should create a wm::WMState.
70 MusClient( 70 MusClient(
71 service_manager::Connector* connector, 71 service_manager::Connector* connector,
72 const service_manager::Identity& identity, 72 const service_manager::Identity& identity,
(...skipping 24 matching lines...) Expand all
97 97
98 // Creates DesktopNativeWidgetAura with DesktopWindowTreeHostMus. This is 98 // Creates DesktopNativeWidgetAura with DesktopWindowTreeHostMus. This is
99 // set as the factory function used for creating NativeWidgets when a 99 // set as the factory function used for creating NativeWidgets when a
100 // NativeWidget has not been explicitly set. 100 // NativeWidget has not been explicitly set.
101 NativeWidget* CreateNativeWidget(const Widget::InitParams& init_params, 101 NativeWidget* CreateNativeWidget(const Widget::InitParams& init_params,
102 internal::NativeWidgetDelegate* delegate); 102 internal::NativeWidgetDelegate* delegate);
103 103
104 void AddObserver(MusClientObserver* observer); 104 void AddObserver(MusClientObserver* observer);
105 void RemoveObserver(MusClientObserver* observer); 105 void RemoveObserver(MusClientObserver* observer);
106 106
107 MusPropertyMirror* mus_property_mirror() {
108 return mus_property_mirror_.get();
109 }
110 void set_mus_property_mirror(std::unique_ptr<MusPropertyMirror> mirror) {
sky 2017/01/27 20:10:45 As this runs a destructor I think it should be Set
msw 2017/01/27 21:19:25 Done.
111 mus_property_mirror_ = std::move(mirror);
112 }
113
107 private: 114 private:
108 friend class AuraInit; 115 friend class AuraInit;
109 friend class test::MusClientTestApi; 116 friend class test::MusClientTestApi;
110 117
111 // aura::WindowTreeClientDelegate: 118 // aura::WindowTreeClientDelegate:
112 void OnEmbed( 119 void OnEmbed(
113 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override; 120 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override;
114 void OnLostConnection(aura::WindowTreeClient* client) override; 121 void OnLostConnection(aura::WindowTreeClient* client) override;
115 void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override; 122 void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override;
116 void OnPointerEventObserved(const ui::PointerEvent& event, 123 void OnPointerEventObserved(const ui::PointerEvent& event,
(...skipping 16 matching lines...) Expand all
133 140
134 base::ObserverList<MusClientObserver> observer_list_; 141 base::ObserverList<MusClientObserver> observer_list_;
135 142
136 // NOTE: this may be null (creation is based on argument supplied to 143 // NOTE: this may be null (creation is based on argument supplied to
137 // constructor). 144 // constructor).
138 std::unique_ptr<wm::WMState> wm_state_; 145 std::unique_ptr<wm::WMState> wm_state_;
139 146
140 std::unique_ptr<ScreenMus> screen_; 147 std::unique_ptr<ScreenMus> screen_;
141 148
142 std::unique_ptr<aura::PropertyConverter> property_converter_; 149 std::unique_ptr<aura::PropertyConverter> property_converter_;
150 std::unique_ptr<MusPropertyMirror> mus_property_mirror_;
143 151
144 std::unique_ptr<aura::WindowTreeClient> window_tree_client_; 152 std::unique_ptr<aura::WindowTreeClient> window_tree_client_;
145 153
146 std::unique_ptr<PointerWatcherEventRouter> pointer_watcher_event_router_; 154 std::unique_ptr<PointerWatcherEventRouter> pointer_watcher_event_router_;
147 155
148 std::unique_ptr<discardable_memory::ClientDiscardableSharedMemoryManager> 156 std::unique_ptr<discardable_memory::ClientDiscardableSharedMemoryManager>
149 discardable_shared_memory_manager_; 157 discardable_shared_memory_manager_;
150 158
151 DISALLOW_COPY_AND_ASSIGN(MusClient); 159 DISALLOW_COPY_AND_ASSIGN(MusClient);
152 }; 160 };
153 161
154 } // namespace views 162 } // namespace views
155 163
156 #endif // UI_VIEWS_MUS_MUS_CLIENT_H_ 164 #endif // UI_VIEWS_MUS_MUS_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698