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

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

Issue 2857963003: Add {Lock,Unlock,Show,Hide}Cursor() to the window manager mojom. (Closed)
Patch Set: sky comments 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/display_unittest.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 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 18 matching lines...) Expand all
29 #include "ui/base/cursor/cursor.h" 29 #include "ui/base/cursor/cursor.h"
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) : window_server_(window_server) {
40 : window_server_(window_server),
41 last_cursor_(ui::CursorData(ui::CursorType::kNull)) {
42 window_server_->window_manager_window_tree_factory_set()->AddObserver(this); 40 window_server_->window_manager_window_tree_factory_set()->AddObserver(this);
43 window_server_->user_id_tracker()->AddObserver(this); 41 window_server_->user_id_tracker()->AddObserver(this);
44 } 42 }
45 43
46 Display::~Display() { 44 Display::~Display() {
47 window_server_->user_id_tracker()->RemoveObserver(this); 45 window_server_->user_id_tracker()->RemoveObserver(this);
48 46
49 window_server_->window_manager_window_tree_factory_set()->RemoveObserver( 47 window_server_->window_manager_window_tree_factory_set()->RemoveObserver(
50 this); 48 this);
51 49
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 for (auto it = window_manager_display_root_map_.begin(); 189 for (auto it = window_manager_display_root_map_.begin();
192 it != window_manager_display_root_map_.end(); ++it) { 190 it != window_manager_display_root_map_.end(); ++it) {
193 if (it->second == display_root) { 191 if (it->second == display_root) {
194 window_manager_display_root_map_.erase(it); 192 window_manager_display_root_map_.erase(it);
195 return; 193 return;
196 } 194 }
197 } 195 }
198 NOTREACHED(); 196 NOTREACHED();
199 } 197 }
200 198
201 void Display::UpdateNativeCursor(const ui::CursorData& cursor) { 199 void Display::SetNativeCursor(const ui::CursorData& cursor) {
202 if (!last_cursor_.IsSameAs(cursor)) { 200 platform_display_->SetCursor(cursor);
203 platform_display_->SetCursor(cursor);
204 last_cursor_ = cursor;
205 }
206 } 201 }
207 202
208 void Display::SetSize(const gfx::Size& size) { 203 void Display::SetSize(const gfx::Size& size) {
209 platform_display_->SetViewportSize(size); 204 platform_display_->SetViewportSize(size);
210 } 205 }
211 206
212 void Display::SetTitle(const std::string& title) { 207 void Display::SetTitle(const std::string& title) {
213 platform_display_->SetTitle(base::UTF8ToUTF16(title)); 208 platform_display_->SetTitle(base::UTF8ToUTF16(title));
214 } 209 }
215 210
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 407
413 UserActivityMonitor* activity_monitor = 408 UserActivityMonitor* activity_monitor =
414 window_server_->GetUserActivityMonitorForUser( 409 window_server_->GetUserActivityMonitorForUser(
415 window_server_->user_id_tracker()->active_id()); 410 window_server_->user_id_tracker()->active_id());
416 activity_monitor->OnUserActivity(); 411 activity_monitor->OnUserActivity();
417 return EventDispatchDetails(); 412 return EventDispatchDetails();
418 } 413 }
419 414
420 } // namespace ws 415 } // namespace ws
421 } // namespace ui 416 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/display.h ('k') | services/ui/ws/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698