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

Side by Side Diff: services/ui/public/cpp/window_manager_delegate.h

Issue 2189893002: services/ui: Create a proper component for the client-lib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 | « services/ui/public/cpp/window.h ('k') | services/ui/public/cpp/window_observer.h » ('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 SERVICES_UI_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_
6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ 6 #define SERVICES_UI_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 <memory>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/callback_forward.h" 15 #include "base/callback_forward.h"
16 #include "services/ui/public/cpp/ui_export.h"
16 #include "services/ui/public/interfaces/cursor.mojom.h" 17 #include "services/ui/public/interfaces/cursor.mojom.h"
17 #include "services/ui/public/interfaces/event_matcher.mojom.h" 18 #include "services/ui/public/interfaces/event_matcher.mojom.h"
18 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" 19 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
19 #include "services/ui/public/interfaces/window_tree_constants.mojom.h" 20 #include "services/ui/public/interfaces/window_tree_constants.mojom.h"
20 #include "ui/events/mojo/event.mojom.h" 21 #include "ui/events/mojo/event.mojom.h"
21 22
22 namespace display { 23 namespace display {
23 class Display; 24 class Display;
24 } 25 }
25 26
26 namespace gfx { 27 namespace gfx {
27 class Insets; 28 class Insets;
28 class Rect; 29 class Rect;
29 class Vector2d; 30 class Vector2d;
30 } 31 }
31 32
32 namespace ui { 33 namespace ui {
33 class Event; 34 class Event;
34 } 35 }
35 36
36 namespace ui { 37 namespace ui {
37 38
38 class Window; 39 class Window;
39 40
40 // See the mojom with the same name for details on the functions in this 41 // See the mojom with the same name for details on the functions in this
41 // interface. 42 // interface.
42 class WindowManagerClient { 43 class UI_EXPORT WindowManagerClient {
43 public: 44 public:
44 virtual void SetFrameDecorationValues( 45 virtual void SetFrameDecorationValues(
45 mojom::FrameDecorationValuesPtr values) = 0; 46 mojom::FrameDecorationValuesPtr values) = 0;
46 virtual void SetNonClientCursor(Window* window, 47 virtual void SetNonClientCursor(Window* window,
47 mojom::Cursor non_client_cursor) = 0; 48 mojom::Cursor non_client_cursor) = 0;
48 49
49 virtual void AddAccelerator(uint32_t id, 50 virtual void AddAccelerator(uint32_t id,
50 mojom::EventMatcherPtr event_matcher, 51 mojom::EventMatcherPtr event_matcher,
51 const base::Callback<void(bool)>& callback) = 0; 52 const base::Callback<void(bool)>& callback) = 0;
52 virtual void RemoveAccelerator(uint32_t id) = 0; 53 virtual void RemoveAccelerator(uint32_t id) = 0;
53 virtual void AddActivationParent(Window* window) = 0; 54 virtual void AddActivationParent(Window* window) = 0;
54 virtual void RemoveActivationParent(Window* window) = 0; 55 virtual void RemoveActivationParent(Window* window) = 0;
55 virtual void ActivateNextWindow() = 0; 56 virtual void ActivateNextWindow() = 0;
56 virtual void SetUnderlaySurfaceOffsetAndExtendedHitArea( 57 virtual void SetUnderlaySurfaceOffsetAndExtendedHitArea(
57 Window* window, 58 Window* window,
58 const gfx::Vector2d& offset, 59 const gfx::Vector2d& offset,
59 const gfx::Insets& hit_area) = 0; 60 const gfx::Insets& hit_area) = 0;
60 61
61 protected: 62 protected:
62 virtual ~WindowManagerClient() {} 63 virtual ~WindowManagerClient() {}
63 }; 64 };
64 65
65 // Used by clients implementing a window manager. 66 // Used by clients implementing a window manager.
66 // TODO(sky): this should be called WindowManager, but that's rather confusing 67 // TODO(sky): this should be called WindowManager, but that's rather confusing
67 // currently. 68 // currently.
68 class WindowManagerDelegate { 69 class UI_EXPORT WindowManagerDelegate {
69 public: 70 public:
70 // Called once to give the delegate access to functions only exposed to 71 // Called once to give the delegate access to functions only exposed to
71 // the WindowManager. 72 // the WindowManager.
72 virtual void SetWindowManagerClient(WindowManagerClient* client) = 0; 73 virtual void SetWindowManagerClient(WindowManagerClient* client) = 0;
73 74
74 // A client requested the bounds of |window| to change to |bounds|. Return 75 // A client requested the bounds of |window| to change to |bounds|. Return
75 // true if the bounds are allowed to change. A return value of false 76 // true if the bounds are allowed to change. A return value of false
76 // indicates the change is not allowed. 77 // indicates the change is not allowed.
77 // NOTE: This should not change the bounds of |window|. Instead return the 78 // NOTE: This should not change the bounds of |window|. Instead return the
78 // bounds the window should be in |bounds|. 79 // bounds the window should be in |bounds|.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 117
117 virtual void OnWmCancelMoveLoop(Window* window) = 0; 118 virtual void OnWmCancelMoveLoop(Window* window) = 0;
118 119
119 protected: 120 protected:
120 virtual ~WindowManagerDelegate() {} 121 virtual ~WindowManagerDelegate() {}
121 }; 122 };
122 123
123 } // namespace ui 124 } // namespace ui
124 125
125 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ 126 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_
OLDNEW
« no previous file with comments | « services/ui/public/cpp/window.h ('k') | services/ui/public/cpp/window_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698