OLD | NEW |
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 COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ |
6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" |
14 | 15 |
15 namespace gfx { | 16 namespace gfx { |
16 class Rect; | 17 class Rect; |
17 } | 18 } |
18 | 19 |
19 namespace mus { | 20 namespace mus { |
20 | 21 |
21 class Window; | 22 class Window; |
22 | 23 |
| 24 class WindowManagerClient { |
| 25 public: |
| 26 virtual void SetFrameDecorationValues( |
| 27 mojom::FrameDecorationValuesPtr values) = 0; |
| 28 |
| 29 protected: |
| 30 virtual ~WindowManagerClient() {} |
| 31 }; |
| 32 |
23 // Used by clients implementing a window manager. | 33 // Used by clients implementing a window manager. |
24 // TODO(sky): this should be called WindowManager, but that's rather confusing | 34 // TODO(sky): this should be called WindowManager, but that's rather confusing |
25 // currently. | 35 // currently. |
26 class WindowManagerDelegate { | 36 class WindowManagerDelegate { |
27 public: | 37 public: |
| 38 // Called once to give the delegate access to functions only exposed to |
| 39 // the WindowManager. |
| 40 virtual void SetWindowManagerClient(WindowManagerClient* client) = 0; |
| 41 |
28 // A client requested the bounds of |window| to change to |bounds|. Return | 42 // A client requested the bounds of |window| to change to |bounds|. Return |
29 // true if the bounds are allowed to change. A return value of false | 43 // true if the bounds are allowed to change. A return value of false |
30 // indicates the change is not allowed. | 44 // indicates the change is not allowed. |
31 // NOTE: This should not change the bounds of |window|. Instead return the | 45 // NOTE: This should not change the bounds of |window|. Instead return the |
32 // bounds the window should be in |bounds|. | 46 // bounds the window should be in |bounds|. |
33 virtual bool OnWmSetBounds(Window* window, gfx::Rect* bounds) = 0; | 47 virtual bool OnWmSetBounds(Window* window, gfx::Rect* bounds) = 0; |
34 | 48 |
35 // A client requested the shared property named |name| to change to | 49 // A client requested the shared property named |name| to change to |
36 // |new_data|. Return true to allow the change to |new_data|, false | 50 // |new_data|. Return true to allow the change to |new_data|, false |
37 // otherwise. | 51 // otherwise. |
(...skipping 10 matching lines...) Expand all Loading... |
48 virtual Window* OnWmCreateTopLevelWindow( | 62 virtual Window* OnWmCreateTopLevelWindow( |
49 std::map<std::string, std::vector<uint8_t>>* properties) = 0; | 63 std::map<std::string, std::vector<uint8_t>>* properties) = 0; |
50 | 64 |
51 protected: | 65 protected: |
52 virtual ~WindowManagerDelegate() {} | 66 virtual ~WindowManagerDelegate() {} |
53 }; | 67 }; |
54 | 68 |
55 } // namespace mus | 69 } // namespace mus |
56 | 70 |
57 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ | 71 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ |
OLD | NEW |