| OLD | NEW |
| 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 #include "services/ui/ws/server_window.h" | 5 #include "services/ui/ws/server_window.h" |
| 6 | 6 |
| 7 #include <inttypes.h> | 7 #include <inttypes.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 : delegate_(delegate), | 27 : delegate_(delegate), |
| 28 id_(id), | 28 id_(id), |
| 29 frame_sink_id_(WindowIdToTransportId(id), 0), | 29 frame_sink_id_(WindowIdToTransportId(id), 0), |
| 30 parent_(nullptr), | 30 parent_(nullptr), |
| 31 stacking_target_(nullptr), | 31 stacking_target_(nullptr), |
| 32 transient_parent_(nullptr), | 32 transient_parent_(nullptr), |
| 33 modal_type_(MODAL_TYPE_NONE), | 33 modal_type_(MODAL_TYPE_NONE), |
| 34 visible_(false), | 34 visible_(false), |
| 35 // Default to POINTER as CURSOR_NULL doesn't change the cursor, it leaves | 35 // Default to POINTER as CURSOR_NULL doesn't change the cursor, it leaves |
| 36 // the last non-null cursor. | 36 // the last non-null cursor. |
| 37 cursor_id_(mojom::Cursor::POINTER), | 37 cursor_id_(mojom::CursorType::POINTER), |
| 38 non_client_cursor_id_(mojom::Cursor::POINTER), | 38 non_client_cursor_id_(mojom::CursorType::POINTER), |
| 39 opacity_(1), | 39 opacity_(1), |
| 40 can_focus_(true), | 40 can_focus_(true), |
| 41 properties_(properties), | 41 properties_(properties), |
| 42 // Don't notify newly added observers during notification. This causes | 42 // Don't notify newly added observers during notification. This causes |
| 43 // problems for code that adds an observer as part of an observer | 43 // problems for code that adds an observer as part of an observer |
| 44 // notification (such as ServerWindowDrawTracker). | 44 // notification (such as ServerWindowDrawTracker). |
| 45 observers_( | 45 observers_( |
| 46 base::ObserverList<ServerWindowObserver>::NOTIFY_EXISTING_ONLY) { | 46 base::ObserverList<ServerWindowObserver>::NOTIFY_EXISTING_ONLY) { |
| 47 DCHECK(delegate); // Must provide a delegate. | 47 DCHECK(delegate); // Must provide a delegate. |
| 48 } | 48 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 292 |
| 293 void ServerWindow::SetOpacity(float value) { | 293 void ServerWindow::SetOpacity(float value) { |
| 294 if (value == opacity_) | 294 if (value == opacity_) |
| 295 return; | 295 return; |
| 296 float old_opacity = opacity_; | 296 float old_opacity = opacity_; |
| 297 opacity_ = value; | 297 opacity_ = value; |
| 298 for (auto& observer : observers_) | 298 for (auto& observer : observers_) |
| 299 observer.OnWindowOpacityChanged(this, old_opacity, opacity_); | 299 observer.OnWindowOpacityChanged(this, old_opacity, opacity_); |
| 300 } | 300 } |
| 301 | 301 |
| 302 void ServerWindow::SetPredefinedCursor(ui::mojom::Cursor value) { | 302 void ServerWindow::SetPredefinedCursor(ui::mojom::CursorType value) { |
| 303 if (value == cursor_id_) | 303 if (value == cursor_id_) |
| 304 return; | 304 return; |
| 305 cursor_id_ = value; | 305 cursor_id_ = value; |
| 306 for (auto& observer : observers_) | 306 for (auto& observer : observers_) |
| 307 observer.OnWindowPredefinedCursorChanged(this, value); | 307 observer.OnWindowPredefinedCursorChanged(this, value); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void ServerWindow::SetNonClientCursor(ui::mojom::Cursor value) { | 310 void ServerWindow::SetNonClientCursor(ui::mojom::CursorType value) { |
| 311 if (value == non_client_cursor_id_) | 311 if (value == non_client_cursor_id_) |
| 312 return; | 312 return; |
| 313 non_client_cursor_id_ = value; | 313 non_client_cursor_id_ = value; |
| 314 for (auto& observer : observers_) | 314 for (auto& observer : observers_) |
| 315 observer.OnWindowNonClientCursorChanged(this, value); | 315 observer.OnWindowNonClientCursorChanged(this, value); |
| 316 } | 316 } |
| 317 | 317 |
| 318 void ServerWindow::SetTransform(const gfx::Transform& transform) { | 318 void ServerWindow::SetTransform(const gfx::Transform& transform) { |
| 319 if (transform_ == transform) | 319 if (transform_ == transform) |
| 320 return; | 320 return; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 window->OnStackingChanged(); | 471 window->OnStackingChanged(); |
| 472 } | 472 } |
| 473 | 473 |
| 474 // static | 474 // static |
| 475 ServerWindow** ServerWindow::GetStackingTarget(ServerWindow* window) { | 475 ServerWindow** ServerWindow::GetStackingTarget(ServerWindow* window) { |
| 476 return &window->stacking_target_; | 476 return &window->stacking_target_; |
| 477 } | 477 } |
| 478 | 478 |
| 479 } // namespace ws | 479 } // namespace ws |
| 480 } // namespace ui | 480 } // namespace ui |
| OLD | NEW |