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

Side by Side Diff: components/mus/ws/server_window.h

Issue 1465803003: mus: Let clients set the cursor of their window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do it the other way + explicit checks that it is a mouse pointer. Created 5 years 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 | « components/mus/ws/operation.h ('k') | components/mus/ws/server_window.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_WS_SERVER_WINDOW_H_ 5 #ifndef COMPONENTS_MUS_WS_SERVER_WINDOW_H_
6 #define COMPONENTS_MUS_WS_SERVER_WINDOW_H_ 6 #define COMPONENTS_MUS_WS_SERVER_WINDOW_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 void StackChildAtTop(ServerWindow* child); 67 void StackChildAtTop(ServerWindow* child);
68 68
69 const gfx::Rect& bounds() const { return bounds_; } 69 const gfx::Rect& bounds() const { return bounds_; }
70 // Sets the bounds. If the size changes this implicitly resets the client 70 // Sets the bounds. If the size changes this implicitly resets the client
71 // area to fill the whole bounds. 71 // area to fill the whole bounds.
72 void SetBounds(const gfx::Rect& bounds); 72 void SetBounds(const gfx::Rect& bounds);
73 73
74 const gfx::Insets& client_area() const { return client_area_; } 74 const gfx::Insets& client_area() const { return client_area_; }
75 void SetClientArea(const gfx::Insets& insets); 75 void SetClientArea(const gfx::Insets& insets);
76 76
77 int32_t cursor() const { return cursor_id_; }
78
77 const ServerWindow* parent() const { return parent_; } 79 const ServerWindow* parent() const { return parent_; }
78 ServerWindow* parent() { return parent_; } 80 ServerWindow* parent() { return parent_; }
79 81
80 const ServerWindow* GetRoot() const; 82 const ServerWindow* GetRoot() const;
81 ServerWindow* GetRoot() { 83 ServerWindow* GetRoot() {
82 return const_cast<ServerWindow*>( 84 return const_cast<ServerWindow*>(
83 const_cast<const ServerWindow*>(this)->GetRoot()); 85 const_cast<const ServerWindow*>(this)->GetRoot());
84 } 86 }
85 87
86 std::vector<const ServerWindow*> GetChildren() const; 88 std::vector<const ServerWindow*> GetChildren() const;
(...skipping 17 matching lines...) Expand all
104 bool Contains(const ServerWindow* window) const; 106 bool Contains(const ServerWindow* window) const;
105 107
106 // Returns the visibility requested by this window. IsDrawn() returns whether 108 // Returns the visibility requested by this window. IsDrawn() returns whether
107 // the window is actually visible on screen. 109 // the window is actually visible on screen.
108 bool visible() const { return visible_; } 110 bool visible() const { return visible_; }
109 void SetVisible(bool value); 111 void SetVisible(bool value);
110 112
111 float opacity() const { return opacity_; } 113 float opacity() const { return opacity_; }
112 void SetOpacity(float value); 114 void SetOpacity(float value);
113 115
116 void SetPredefinedCursor(mus::mojom::Cursor cursor_id);
117
114 const gfx::Transform& transform() const { return transform_; } 118 const gfx::Transform& transform() const { return transform_; }
115 void SetTransform(const gfx::Transform& transform); 119 void SetTransform(const gfx::Transform& transform);
116 120
117 const std::map<std::string, std::vector<uint8_t>>& properties() const { 121 const std::map<std::string, std::vector<uint8_t>>& properties() const {
118 return properties_; 122 return properties_;
119 } 123 }
120 void SetProperty(const std::string& name, const std::vector<uint8_t>* value); 124 void SetProperty(const std::string& name, const std::vector<uint8_t>* value);
121 125
122 void SetTextInputState(const ui::TextInputState& state); 126 void SetTextInputState(const ui::TextInputState& state);
123 const ui::TextInputState& text_input_state() const { 127 const ui::TextInputState& text_input_state() const {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // If non-null we're actively restacking transient as the result of a 188 // If non-null we're actively restacking transient as the result of a
185 // transient ancestor changing. 189 // transient ancestor changing.
186 ServerWindow* stacking_target_; 190 ServerWindow* stacking_target_;
187 ServerWindow* transient_parent_; 191 ServerWindow* transient_parent_;
188 Windows transient_children_; 192 Windows transient_children_;
189 193
190 bool visible_; 194 bool visible_;
191 gfx::Rect bounds_; 195 gfx::Rect bounds_;
192 gfx::Insets client_area_; 196 gfx::Insets client_area_;
193 scoped_ptr<ServerWindowSurfaceManager> surface_manager_; 197 scoped_ptr<ServerWindowSurfaceManager> surface_manager_;
198 mojom::Cursor cursor_id_;
194 float opacity_; 199 float opacity_;
195 bool can_focus_; 200 bool can_focus_;
196 gfx::Transform transform_; 201 gfx::Transform transform_;
197 ui::TextInputState text_input_state_; 202 ui::TextInputState text_input_state_;
198 203
199 Properties properties_; 204 Properties properties_;
200 205
201 gfx::Vector2d underlay_offset_; 206 gfx::Vector2d underlay_offset_;
202 207
203 // The hit test for windows extends outside the bounds of the window by this 208 // The hit test for windows extends outside the bounds of the window by this
204 // amount. 209 // amount.
205 gfx::Insets extended_hit_test_region_; 210 gfx::Insets extended_hit_test_region_;
206 211
207 base::ObserverList<ServerWindowObserver> observers_; 212 base::ObserverList<ServerWindowObserver> observers_;
208 213
209 DISALLOW_COPY_AND_ASSIGN(ServerWindow); 214 DISALLOW_COPY_AND_ASSIGN(ServerWindow);
210 }; 215 };
211 216
212 } // namespace ws 217 } // namespace ws
213 } // namespace mus 218 } // namespace mus
214 219
215 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_H_ 220 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_H_
OLDNEW
« no previous file with comments | « components/mus/ws/operation.h ('k') | components/mus/ws/server_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698