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

Side by Side Diff: services/ui/ws/server_window.h

Issue 2830703003: [views-mus] Support custom cursors. (Closed)
Patch Set: rebase to tot Created 3 years, 7 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
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 SERVICES_UI_WS_SERVER_WINDOW_H_ 5 #ifndef SERVICES_UI_WS_SERVER_WINDOW_H_
6 #define SERVICES_UI_WS_SERVER_WINDOW_H_ 6 #define SERVICES_UI_WS_SERVER_WINDOW_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void SetClientArea(const gfx::Insets& insets, 98 void SetClientArea(const gfx::Insets& insets,
99 const std::vector<gfx::Rect>& additional_client_areas); 99 const std::vector<gfx::Rect>& additional_client_areas);
100 100
101 const gfx::Rect* hit_test_mask() const { return hit_test_mask_.get(); } 101 const gfx::Rect* hit_test_mask() const { return hit_test_mask_.get(); }
102 void SetHitTestMask(const gfx::Rect& mask); 102 void SetHitTestMask(const gfx::Rect& mask);
103 void ClearHitTestMask(); 103 void ClearHitTestMask();
104 104
105 bool can_accept_drops() const { return accepts_drops_; } 105 bool can_accept_drops() const { return accepts_drops_; }
106 void SetCanAcceptDrops(bool accepts_drags); 106 void SetCanAcceptDrops(bool accepts_drags);
107 107
108 ui::mojom::CursorType cursor() const { return cursor_id_; } 108 const ui::CursorData& cursor() const { return cursor_; }
109 ui::mojom::CursorType non_client_cursor() const { 109 const ui::CursorData& non_client_cursor() const { return non_client_cursor_; }
110 return non_client_cursor_id_;
111 }
112 110
113 const ServerWindow* parent() const { return parent_; } 111 const ServerWindow* parent() const { return parent_; }
114 ServerWindow* parent() { return parent_; } 112 ServerWindow* parent() { return parent_; }
115 113
116 // NOTE: this returns null if the window does not have an ancestor associated 114 // NOTE: this returns null if the window does not have an ancestor associated
117 // with a display. 115 // with a display.
118 const ServerWindow* GetRoot() const; 116 const ServerWindow* GetRoot() const;
119 ServerWindow* GetRoot() { 117 ServerWindow* GetRoot() {
120 return const_cast<ServerWindow*>( 118 return const_cast<ServerWindow*>(
121 const_cast<const ServerWindow*>(this)->GetRoot()); 119 const_cast<const ServerWindow*>(this)->GetRoot());
(...skipping 22 matching lines...) Expand all
144 bool Contains(const ServerWindow* window) const; 142 bool Contains(const ServerWindow* window) const;
145 143
146 // Returns the visibility requested by this window. IsDrawn() returns whether 144 // Returns the visibility requested by this window. IsDrawn() returns whether
147 // the window is actually visible on screen. 145 // the window is actually visible on screen.
148 bool visible() const { return visible_; } 146 bool visible() const { return visible_; }
149 void SetVisible(bool value); 147 void SetVisible(bool value);
150 148
151 float opacity() const { return opacity_; } 149 float opacity() const { return opacity_; }
152 void SetOpacity(float value); 150 void SetOpacity(float value);
153 151
154 void SetPredefinedCursor(ui::mojom::CursorType cursor_id); 152 void SetCursor(const ui::CursorData& cursor);
sky 2017/04/26 22:16:16 Should these two functions take a ui::CursorData t
Elliot Glaysher 2017/04/26 23:09:04 Done. (A previous version of this patch actually
155 void SetNonClientCursor(ui::mojom::CursorType cursor_id); 153 void SetNonClientCursor(const ui::CursorData& cursor);
156 154
157 const gfx::Transform& transform() const { return transform_; } 155 const gfx::Transform& transform() const { return transform_; }
158 void SetTransform(const gfx::Transform& transform); 156 void SetTransform(const gfx::Transform& transform);
159 157
160 const std::map<std::string, std::vector<uint8_t>>& properties() const { 158 const std::map<std::string, std::vector<uint8_t>>& properties() const {
161 return properties_; 159 return properties_;
162 } 160 }
163 void SetProperty(const std::string& name, const std::vector<uint8_t>* value); 161 void SetProperty(const std::string& name, const std::vector<uint8_t>* value);
164 162
165 std::string GetName() const; 163 std::string GetName() const;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 ServerWindow* transient_parent_; 243 ServerWindow* transient_parent_;
246 Windows transient_children_; 244 Windows transient_children_;
247 245
248 ModalType modal_type_; 246 ModalType modal_type_;
249 bool visible_; 247 bool visible_;
250 gfx::Rect bounds_; 248 gfx::Rect bounds_;
251 gfx::Insets client_area_; 249 gfx::Insets client_area_;
252 std::vector<gfx::Rect> additional_client_areas_; 250 std::vector<gfx::Rect> additional_client_areas_;
253 std::unique_ptr<ServerWindowCompositorFrameSinkManager> 251 std::unique_ptr<ServerWindowCompositorFrameSinkManager>
254 compositor_frame_sink_manager_; 252 compositor_frame_sink_manager_;
255 mojom::CursorType cursor_id_; 253 ui::CursorData cursor_;
256 mojom::CursorType non_client_cursor_id_; 254 ui::CursorData non_client_cursor_;
257 float opacity_; 255 float opacity_;
258 bool can_focus_; 256 bool can_focus_;
259 mojom::EventTargetingPolicy event_targeting_policy_ = 257 mojom::EventTargetingPolicy event_targeting_policy_ =
260 mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS; 258 mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS;
261 gfx::Transform transform_; 259 gfx::Transform transform_;
262 ui::TextInputState text_input_state_; 260 ui::TextInputState text_input_state_;
263 261
264 Properties properties_; 262 Properties properties_;
265 263
266 gfx::Vector2d underlay_offset_; 264 gfx::Vector2d underlay_offset_;
(...skipping 12 matching lines...) Expand all
279 277
280 base::ObserverList<ServerWindowObserver> observers_; 278 base::ObserverList<ServerWindowObserver> observers_;
281 279
282 DISALLOW_COPY_AND_ASSIGN(ServerWindow); 280 DISALLOW_COPY_AND_ASSIGN(ServerWindow);
283 }; 281 };
284 282
285 } // namespace ws 283 } // namespace ws
286 } // namespace ui 284 } // namespace ui
287 285
288 #endif // SERVICES_UI_WS_SERVER_WINDOW_H_ 286 #endif // SERVICES_UI_WS_SERVER_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698