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

Side by Side Diff: mash/wm/window_manager.h

Issue 1907153002: mash/wm: Fix detecting container windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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/wm/root_window_controller.cc ('k') | mash/wm/window_manager.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 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 MASH_WM_WINDOW_MANAGER_H_ 5 #ifndef MASH_WM_WINDOW_MANAGER_H_
6 #define MASH_WM_WINDOW_MANAGER_H_ 6 #define MASH_WM_WINDOW_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "components/mus/common/types.h" 13 #include "components/mus/common/types.h"
14 #include "components/mus/public/cpp/window_manager_delegate.h" 14 #include "components/mus/public/cpp/window_manager_delegate.h"
15 #include "components/mus/public/cpp/window_observer.h" 15 #include "components/mus/public/cpp/window_observer.h"
16 #include "components/mus/public/cpp/window_tracker.h"
16 #include "components/mus/public/interfaces/window_manager.mojom.h" 17 #include "components/mus/public/interfaces/window_manager.mojom.h"
17 #include "mash/session/public/interfaces/session.mojom.h" 18 #include "mash/session/public/interfaces/session.mojom.h"
19 #include "mash/wm/disconnected_app_handler.h"
18 #include "mojo/public/cpp/bindings/binding.h" 20 #include "mojo/public/cpp/bindings/binding.h"
19 21
20 namespace mash { 22 namespace mash {
21 namespace wm { 23 namespace wm {
22 24
23 class RootWindowController; 25 class RootWindowController;
24 26
25 class WindowManager : public mus::WindowObserver, 27 class WindowManager : public mus::WindowTracker,
26 public mus::WindowManagerDelegate, 28 public mus::WindowManagerDelegate,
27 public session::mojom::ScreenlockStateListener { 29 public session::mojom::ScreenlockStateListener {
28 public: 30 public:
29 WindowManager(); 31 WindowManager();
30 ~WindowManager() override; 32 ~WindowManager() override;
31 33
32 void Initialize(RootWindowController* root_controller, 34 void Initialize(RootWindowController* root_controller,
33 session::mojom::Session* session); 35 session::mojom::Session* session);
34 36
35 mus::WindowManagerClient* window_manager_client() { 37 mus::WindowManagerClient* window_manager_client() {
36 return window_manager_client_; 38 return window_manager_client_;
37 } 39 }
38 40
39 private: 41 private:
40 gfx::Rect CalculateDefaultBounds(mus::Window* window) const; 42 gfx::Rect CalculateDefaultBounds(mus::Window* window) const;
41 gfx::Rect GetMaximizedWindowBounds() const; 43 gfx::Rect GetMaximizedWindowBounds() const;
42 44
43 mus::Window* NewTopLevelWindow( 45 mus::Window* NewTopLevelWindow(
44 std::map<std::string, std::vector<uint8_t>>* properties); 46 std::map<std::string, std::vector<uint8_t>>* properties);
45 47
46 // mus::WindowObserver: 48 // mus::WindowObserver:
47 void OnTreeChanging(const TreeChangeParams& params) override; 49 void OnTreeChanging(const TreeChangeParams& params) override;
48 void OnWindowEmbeddedAppDisconnected(mus::Window* window) override;
49 50
50 // WindowManagerDelegate: 51 // WindowManagerDelegate:
51 void SetWindowManagerClient(mus::WindowManagerClient* client) override; 52 void SetWindowManagerClient(mus::WindowManagerClient* client) override;
52 bool OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) override; 53 bool OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) override;
53 bool OnWmSetProperty( 54 bool OnWmSetProperty(
54 mus::Window* window, 55 mus::Window* window,
55 const std::string& name, 56 const std::string& name,
56 std::unique_ptr<std::vector<uint8_t>>* new_data) override; 57 std::unique_ptr<std::vector<uint8_t>>* new_data) override;
57 mus::Window* OnWmCreateTopLevelWindow( 58 mus::Window* OnWmCreateTopLevelWindow(
58 std::map<std::string, std::vector<uint8_t>>* properties) override; 59 std::map<std::string, std::vector<uint8_t>>* properties) override;
59 void OnAccelerator(uint32_t id, const ui::Event& event) override; 60 void OnAccelerator(uint32_t id, const ui::Event& event) override;
60 61
61 // session::mojom::ScreenlockStateListener: 62 // session::mojom::ScreenlockStateListener:
62 void ScreenlockStateChanged(bool locked) override; 63 void ScreenlockStateChanged(bool locked) override;
63 64
64 RootWindowController* root_controller_; 65 RootWindowController* root_controller_;
65 mus::WindowManagerClient* window_manager_client_; 66 mus::WindowManagerClient* window_manager_client_;
67 DisconnectedAppHandler disconnected_app_handler_;
66 68
67 mojo::Binding<session::mojom::ScreenlockStateListener> binding_; 69 mojo::Binding<session::mojom::ScreenlockStateListener> binding_;
68 70
69 DISALLOW_COPY_AND_ASSIGN(WindowManager); 71 DISALLOW_COPY_AND_ASSIGN(WindowManager);
70 }; 72 };
71 73
72 } // namespace wm 74 } // namespace wm
73 } // namespace mash 75 } // namespace mash
74 76
75 #endif // MASH_WM_WINDOW_MANAGER_H_ 77 #endif // MASH_WM_WINDOW_MANAGER_H_
OLDNEW
« no previous file with comments | « mash/wm/root_window_controller.cc ('k') | mash/wm/window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698