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 <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 | 14 |
14 namespace gfx { | 15 namespace gfx { |
15 class Rect; | 16 class Rect; |
16 } | 17 } |
17 | 18 |
18 namespace mus { | 19 namespace mus { |
19 | 20 |
(...skipping 11 matching lines...) Expand all Loading... |
31 // bounds the window should be in |bounds|. | 32 // bounds the window should be in |bounds|. |
32 virtual bool OnWmSetBounds(Window* window, gfx::Rect* bounds) = 0; | 33 virtual bool OnWmSetBounds(Window* window, gfx::Rect* bounds) = 0; |
33 | 34 |
34 // A client requested the shared property named |name| to change to | 35 // A client requested the shared property named |name| to change to |
35 // |new_data|. Return true to allow the change to |new_data|, false | 36 // |new_data|. Return true to allow the change to |new_data|, false |
36 // otherwise. | 37 // otherwise. |
37 virtual bool OnWmSetProperty(Window* window, | 38 virtual bool OnWmSetProperty(Window* window, |
38 const std::string& name, | 39 const std::string& name, |
39 scoped_ptr<std::vector<uint8_t>>* new_data) = 0; | 40 scoped_ptr<std::vector<uint8_t>>* new_data) = 0; |
40 | 41 |
| 42 // A client has requested a new top level window. The delegate should create |
| 43 // and parent the window appropriately and return it. |properties| is the |
| 44 // supplied properties from the client requesting the new window. The |
| 45 // delegate may modify |properties| before calling NewWindow(), but the |
| 46 // delegate does *not* own |properties|, they are valid only for the life |
| 47 // of OnWmCreateTopLevelWindow(). |
| 48 virtual Window* OnWmCreateTopLevelWindow( |
| 49 std::map<std::string, std::vector<uint8_t>>* properties) = 0; |
| 50 |
41 protected: | 51 protected: |
42 virtual ~WindowManagerDelegate() {} | 52 virtual ~WindowManagerDelegate() {} |
43 }; | 53 }; |
44 | 54 |
45 } // namespace mus | 55 } // namespace mus |
46 | 56 |
47 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ | 57 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ |
OLD | NEW |