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

Side by Side Diff: ash/wm/native_cursor_manager_ash_classic.cc

Issue 2949353003: Implement large cursors in Mushrome. (Closed)
Patch Set: rename everything to CursorSize Created 3 years, 6 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 | « ash/wm/native_cursor_manager_ash_classic.h ('k') | ash/wm/native_cursor_manager_ash_mus.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ash/wm/native_cursor_manager_ash_classic.h" 5 #include "ash/wm/native_cursor_manager_ash_classic.h"
6 6
7 #include "ash/display/cursor_window_controller.h" 7 #include "ash/display/cursor_window_controller.h"
8 #include "ash/display/window_tree_host_manager.h" 8 #include "ash/display/window_tree_host_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 } 113 }
114 cursor.set_device_scale_factor(image_cursors_->GetScale()); 114 cursor.set_device_scale_factor(image_cursors_->GetScale());
115 115
116 delegate->CommitCursor(cursor); 116 delegate->CommitCursor(cursor);
117 117
118 if (delegate->IsCursorVisible()) 118 if (delegate->IsCursorVisible())
119 SetCursorOnAllRootWindows(cursor); 119 SetCursorOnAllRootWindows(cursor);
120 } 120 }
121 121
122 void NativeCursorManagerAshClassic::SetCursorSet( 122 void NativeCursorManagerAshClassic::SetCursorSize(
123 ui::CursorSetType cursor_set, 123 ui::CursorSize cursor_size,
124 ::wm::NativeCursorManagerDelegate* delegate) { 124 ::wm::NativeCursorManagerDelegate* delegate) {
125 image_cursors_->SetCursorSet(cursor_set); 125 image_cursors_->SetCursorSize(cursor_size);
126 delegate->CommitCursorSet(cursor_set); 126 delegate->CommitCursorSize(cursor_size);
127 127
128 // Sets the cursor to reflect the scale change immediately. 128 // Sets the cursor to reflect the scale change immediately.
129 if (delegate->IsCursorVisible()) 129 if (delegate->IsCursorVisible())
130 SetCursor(delegate->GetCursor(), delegate); 130 SetCursor(delegate->GetCursor(), delegate);
131 131
132 Shell::Get() 132 Shell::Get()
133 ->window_tree_host_manager() 133 ->window_tree_host_manager()
134 ->cursor_window_controller() 134 ->cursor_window_controller()
135 ->SetCursorSet(cursor_set); 135 ->SetCursorSize(cursor_size);
136 } 136 }
137 137
138 void NativeCursorManagerAshClassic::SetVisibility( 138 void NativeCursorManagerAshClassic::SetVisibility(
139 bool visible, 139 bool visible,
140 ::wm::NativeCursorManagerDelegate* delegate) { 140 ::wm::NativeCursorManagerDelegate* delegate) {
141 delegate->CommitVisibility(visible); 141 delegate->CommitVisibility(visible);
142 142
143 if (visible) { 143 if (visible) {
144 SetCursor(delegate->GetCursor(), delegate); 144 SetCursor(delegate->GetCursor(), delegate);
145 } else { 145 } else {
(...skipping 15 matching lines...) Expand all
161 disabled_cursor_location_); 161 disabled_cursor_location_);
162 } else { 162 } else {
163 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); 163 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location();
164 } 164 }
165 165
166 SetVisibility(delegate->IsCursorVisible(), delegate); 166 SetVisibility(delegate->IsCursorVisible(), delegate);
167 NotifyMouseEventsEnableStateChange(enabled); 167 NotifyMouseEventsEnableStateChange(enabled);
168 } 168 }
169 169
170 } // namespace ash 170 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/native_cursor_manager_ash_classic.h ('k') | ash/wm/native_cursor_manager_ash_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698