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

Side by Side Diff: mash/wm/bridge/wm_globals_mus.h

Issue 2018823002: Eliminate WindowTreeConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@connection
Patch Set: . Created 4 years, 6 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
« no previous file with comments | « mash/webtest/webtest.cc ('k') | mash/wm/bridge/wm_globals_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
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 MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_ 5 #ifndef MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_
6 #define MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_ 6 #define MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "ash/wm/common/wm_globals.h" 12 #include "ash/wm/common/wm_globals.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "components/mus/public/cpp/window_tree_connection_observer.h" 15 #include "components/mus/public/cpp/window_tree_client_observer.h"
16 16
17 namespace mus { 17 namespace mus {
18 class WindowTreeConnection; 18 class WindowTreeClient;
19 } 19 }
20 20
21 namespace mash { 21 namespace mash {
22 namespace wm { 22 namespace wm {
23 23
24 class WmRootWindowControllerMus; 24 class WmRootWindowControllerMus;
25 class WmWindowMus; 25 class WmWindowMus;
26 26
27 // WmGlobals implementation for mus. 27 // WmGlobals implementation for mus.
28 class WmGlobalsMus : public ash::wm::WmGlobals, 28 class WmGlobalsMus : public ash::wm::WmGlobals,
29 public mus::WindowTreeConnectionObserver { 29 public mus::WindowTreeClientObserver {
30 public: 30 public:
31 explicit WmGlobalsMus(mus::WindowTreeConnection* connection); 31 explicit WmGlobalsMus(mus::WindowTreeClient* client);
32 ~WmGlobalsMus() override; 32 ~WmGlobalsMus() override;
33 33
34 static WmGlobalsMus* Get(); 34 static WmGlobalsMus* Get();
35 35
36 void AddRootWindowController(WmRootWindowControllerMus* controller); 36 void AddRootWindowController(WmRootWindowControllerMus* controller);
37 void RemoveRootWindowController(WmRootWindowControllerMus* controller); 37 void RemoveRootWindowController(WmRootWindowControllerMus* controller);
38 38
39 // Returns the ancestor of |window| (including |window|) that is considered 39 // Returns the ancestor of |window| (including |window|) that is considered
40 // toplevel. |window| may be null. 40 // toplevel. |window| may be null.
41 static WmWindowMus* GetToplevelAncestor(mus::Window* window); 41 static WmWindowMus* GetToplevelAncestor(mus::Window* window);
(...skipping 27 matching lines...) Expand all
69 void RemoveDisplayObserver(ash::wm::WmDisplayObserver* observer) override; 69 void RemoveDisplayObserver(ash::wm::WmDisplayObserver* observer) override;
70 void AddOverviewModeObserver( 70 void AddOverviewModeObserver(
71 ash::wm::WmOverviewModeObserver* observer) override; 71 ash::wm::WmOverviewModeObserver* observer) override;
72 void RemoveOverviewModeObserver( 72 void RemoveOverviewModeObserver(
73 ash::wm::WmOverviewModeObserver* observer) override; 73 ash::wm::WmOverviewModeObserver* observer) override;
74 74
75 private: 75 private:
76 // Returns true if |window| is a window that can have active children. 76 // Returns true if |window| is a window that can have active children.
77 static bool IsActivationParent(mus::Window* window); 77 static bool IsActivationParent(mus::Window* window);
78 78
79 void RemoveConnectionObserver(); 79 void RemoveClientObserver();
80 80
81 // mus::WindowTreeConnectionObserver: 81 // mus::WindowTreeClientObserver:
82 void OnWindowTreeFocusChanged(mus::Window* gained_focus, 82 void OnWindowTreeFocusChanged(mus::Window* gained_focus,
83 mus::Window* lost_focus) override; 83 mus::Window* lost_focus) override;
84 void OnWillDestroyConnection(mus::WindowTreeConnection* connection) override; 84 void OnWillDestroyClient(mus::WindowTreeClient* client) override;
85 85
86 mus::WindowTreeConnection* connection_; 86 mus::WindowTreeClient* client_;
87 87
88 std::vector<WmRootWindowControllerMus*> root_window_controllers_; 88 std::vector<WmRootWindowControllerMus*> root_window_controllers_;
89 89
90 base::ObserverList<ash::wm::WmActivationObserver> activation_observers_; 90 base::ObserverList<ash::wm::WmActivationObserver> activation_observers_;
91 91
92 DISALLOW_COPY_AND_ASSIGN(WmGlobalsMus); 92 DISALLOW_COPY_AND_ASSIGN(WmGlobalsMus);
93 }; 93 };
94 94
95 } // namespace wm 95 } // namespace wm
96 } // namespace mash 96 } // namespace mash
97 97
98 #endif // MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_ 98 #endif // MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_
OLDNEW
« no previous file with comments | « mash/webtest/webtest.cc ('k') | mash/wm/bridge/wm_globals_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698