| 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 <memory> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "components/mus/public/interfaces/input_event_matcher.mojom.h" | 15 #include "components/mus/public/interfaces/input_event_matcher.mojom.h" |
| 16 #include "components/mus/public/interfaces/input_events.mojom.h" | 16 #include "components/mus/public/interfaces/input_events.mojom.h" |
| 17 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" | 17 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" |
| 18 | 18 |
| 19 namespace gfx { | 19 namespace gfx { |
| 20 class Insets; | 20 class Insets; |
| 21 class Rect; | 21 class Rect; |
| 22 class Vector2d; | 22 class Vector2d; |
| 23 } | 23 } |
| 24 | 24 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // A client requested the bounds of |window| to change to |bounds|. Return | 65 // A client requested the bounds of |window| to change to |bounds|. Return |
| 66 // true if the bounds are allowed to change. A return value of false | 66 // true if the bounds are allowed to change. A return value of false |
| 67 // indicates the change is not allowed. | 67 // indicates the change is not allowed. |
| 68 // NOTE: This should not change the bounds of |window|. Instead return the | 68 // NOTE: This should not change the bounds of |window|. Instead return the |
| 69 // bounds the window should be in |bounds|. | 69 // bounds the window should be in |bounds|. |
| 70 virtual bool OnWmSetBounds(Window* window, gfx::Rect* bounds) = 0; | 70 virtual bool OnWmSetBounds(Window* window, gfx::Rect* bounds) = 0; |
| 71 | 71 |
| 72 // A client requested the shared property named |name| to change to | 72 // A client requested the shared property named |name| to change to |
| 73 // |new_data|. Return true to allow the change to |new_data|, false | 73 // |new_data|. Return true to allow the change to |new_data|, false |
| 74 // otherwise. | 74 // otherwise. |
| 75 virtual bool OnWmSetProperty(Window* window, | 75 virtual bool OnWmSetProperty( |
| 76 const std::string& name, | 76 Window* window, |
| 77 scoped_ptr<std::vector<uint8_t>>* new_data) = 0; | 77 const std::string& name, |
| 78 std::unique_ptr<std::vector<uint8_t>>* new_data) = 0; |
| 78 | 79 |
| 79 // A client has requested a new top level window. The delegate should create | 80 // A client has requested a new top level window. The delegate should create |
| 80 // and parent the window appropriately and return it. |properties| is the | 81 // and parent the window appropriately and return it. |properties| is the |
| 81 // supplied properties from the client requesting the new window. The | 82 // supplied properties from the client requesting the new window. The |
| 82 // delegate may modify |properties| before calling NewWindow(), but the | 83 // delegate may modify |properties| before calling NewWindow(), but the |
| 83 // delegate does *not* own |properties|, they are valid only for the life | 84 // delegate does *not* own |properties|, they are valid only for the life |
| 84 // of OnWmCreateTopLevelWindow(). | 85 // of OnWmCreateTopLevelWindow(). |
| 85 virtual Window* OnWmCreateTopLevelWindow( | 86 virtual Window* OnWmCreateTopLevelWindow( |
| 86 std::map<std::string, std::vector<uint8_t>>* properties) = 0; | 87 std::map<std::string, std::vector<uint8_t>>* properties) = 0; |
| 87 | 88 |
| 88 virtual void OnAccelerator(uint32_t id, const ui::Event& event) = 0; | 89 virtual void OnAccelerator(uint32_t id, const ui::Event& event) = 0; |
| 89 | 90 |
| 90 protected: | 91 protected: |
| 91 virtual ~WindowManagerDelegate() {} | 92 virtual ~WindowManagerDelegate() {} |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 } // namespace mus | 95 } // namespace mus |
| 95 | 96 |
| 96 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ | 97 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ |
| OLD | NEW |