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

Side by Side Diff: services/ui/ws/display.cc

Issue 2830703003: [views-mus] Support custom cursors. (Closed)
Patch Set: fix cast_shell_linux 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
« no previous file with comments | « services/ui/ws/display.h ('k') | services/ui/ws/drag_controller.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 #include "services/ui/ws/display.h" 5 #include "services/ui/ws/display.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 19 matching lines...) Expand all
30 #include "ui/display/screen.h" 30 #include "ui/display/screen.h"
31 31
32 #if defined(USE_OZONE) 32 #if defined(USE_OZONE)
33 #include "ui/ozone/public/ozone_platform.h" 33 #include "ui/ozone/public/ozone_platform.h"
34 #endif 34 #endif
35 35
36 namespace ui { 36 namespace ui {
37 namespace ws { 37 namespace ws {
38 38
39 Display::Display(WindowServer* window_server) 39 Display::Display(WindowServer* window_server)
40 : window_server_(window_server), last_cursor_(mojom::CursorType::kNull) { 40 : window_server_(window_server),
41 last_cursor_(ui::CursorData(ui::CursorType::kNull)) {
41 window_server_->window_manager_window_tree_factory_set()->AddObserver(this); 42 window_server_->window_manager_window_tree_factory_set()->AddObserver(this);
42 window_server_->user_id_tracker()->AddObserver(this); 43 window_server_->user_id_tracker()->AddObserver(this);
43 } 44 }
44 45
45 Display::~Display() { 46 Display::~Display() {
46 window_server_->user_id_tracker()->RemoveObserver(this); 47 window_server_->user_id_tracker()->RemoveObserver(this);
47 48
48 window_server_->window_manager_window_tree_factory_set()->RemoveObserver( 49 window_server_->window_manager_window_tree_factory_set()->RemoveObserver(
49 this); 50 this);
50 51
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 for (auto it = window_manager_display_root_map_.begin(); 191 for (auto it = window_manager_display_root_map_.begin();
191 it != window_manager_display_root_map_.end(); ++it) { 192 it != window_manager_display_root_map_.end(); ++it) {
192 if (it->second == display_root) { 193 if (it->second == display_root) {
193 window_manager_display_root_map_.erase(it); 194 window_manager_display_root_map_.erase(it);
194 return; 195 return;
195 } 196 }
196 } 197 }
197 NOTREACHED(); 198 NOTREACHED();
198 } 199 }
199 200
200 void Display::UpdateNativeCursor(mojom::CursorType cursor_id) { 201 void Display::UpdateNativeCursor(const ui::CursorData& cursor) {
201 if (cursor_id != last_cursor_) { 202 if (!last_cursor_.IsSameAs(cursor)) {
202 platform_display_->SetCursorById(cursor_id); 203 platform_display_->SetCursor(cursor);
203 last_cursor_ = cursor_id; 204 last_cursor_ = cursor;
204 } 205 }
205 } 206 }
206 207
207 void Display::SetSize(const gfx::Size& size) { 208 void Display::SetSize(const gfx::Size& size) {
208 platform_display_->SetViewportSize(size); 209 platform_display_->SetViewportSize(size);
209 } 210 }
210 211
211 void Display::SetTitle(const std::string& title) { 212 void Display::SetTitle(const std::string& title) {
212 platform_display_->SetTitle(base::UTF8ToUTF16(title)); 213 platform_display_->SetTitle(base::UTF8ToUTF16(title));
213 } 214 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 412
412 UserActivityMonitor* activity_monitor = 413 UserActivityMonitor* activity_monitor =
413 window_server_->GetUserActivityMonitorForUser( 414 window_server_->GetUserActivityMonitorForUser(
414 window_server_->user_id_tracker()->active_id()); 415 window_server_->user_id_tracker()->active_id());
415 activity_monitor->OnUserActivity(); 416 activity_monitor->OnUserActivity();
416 return EventDispatchDetails(); 417 return EventDispatchDetails();
417 } 418 }
418 419
419 } // namespace ws 420 } // namespace ws
420 } // namespace ui 421 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/display.h ('k') | services/ui/ws/drag_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698