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

Side by Side Diff: trunk/src/ash/wm/ash_native_cursor_manager.cc

Issue 233693002: Revert 263043 "Remove obsolete scale related APIs for cursor" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ash_native_cursor_manager.h" 5 #include "ash/wm/ash_native_cursor_manager.h"
6 6
7 #include "ash/display/cursor_window_controller.h" 7 #include "ash/display/cursor_window_controller.h"
8 #include "ash/display/display_controller.h" 8 #include "ash/display/display_controller.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/image_cursors.h" 10 #include "ash/wm/image_cursors.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Sets the cursor to reflect the scale change immediately. 113 // Sets the cursor to reflect the scale change immediately.
114 if (delegate->IsCursorVisible()) 114 if (delegate->IsCursorVisible())
115 SetCursor(delegate->GetCursor(), delegate); 115 SetCursor(delegate->GetCursor(), delegate);
116 116
117 #if defined(OS_CHROMEOS) 117 #if defined(OS_CHROMEOS)
118 Shell::GetInstance()->display_controller()->cursor_window_controller()-> 118 Shell::GetInstance()->display_controller()->cursor_window_controller()->
119 SetCursorSet(cursor_set); 119 SetCursorSet(cursor_set);
120 #endif 120 #endif
121 } 121 }
122 122
123 void AshNativeCursorManager::SetScale(
124 float scale,
125 ::wm::NativeCursorManagerDelegate* delegate) {
126 image_cursors_->SetScale(scale);
127 delegate->CommitScale(scale);
128
129 // Sets the cursor to reflect the scale change immediately.
130 SetCursor(delegate->GetCursor(), delegate);
131 }
132
123 void AshNativeCursorManager::SetVisibility( 133 void AshNativeCursorManager::SetVisibility(
124 bool visible, 134 bool visible,
125 ::wm::NativeCursorManagerDelegate* delegate) { 135 ::wm::NativeCursorManagerDelegate* delegate) {
126 delegate->CommitVisibility(visible); 136 delegate->CommitVisibility(visible);
127 137
128 if (visible) { 138 if (visible) {
129 SetCursor(delegate->GetCursor(), delegate); 139 SetCursor(delegate->GetCursor(), delegate);
130 } else { 140 } else {
131 gfx::NativeCursor invisible_cursor(ui::kCursorNone); 141 gfx::NativeCursor invisible_cursor(ui::kCursorNone);
132 image_cursors_->SetPlatformCursor(&invisible_cursor); 142 image_cursors_->SetPlatformCursor(&invisible_cursor);
(...skipping 13 matching lines...) Expand all
146 disabled_cursor_location_); 156 disabled_cursor_location_);
147 } else { 157 } else {
148 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location(); 158 disabled_cursor_location_ = aura::Env::GetInstance()->last_mouse_location();
149 } 159 }
150 160
151 SetVisibility(delegate->IsCursorVisible(), delegate); 161 SetVisibility(delegate->IsCursorVisible(), delegate);
152 NotifyMouseEventsEnableStateChange(enabled); 162 NotifyMouseEventsEnableStateChange(enabled);
153 } 163 }
154 164
155 } // namespace ash 165 } // namespace ash
OLDNEW
« no previous file with comments | « trunk/src/ash/wm/ash_native_cursor_manager.h ('k') | trunk/src/ash/wm/ash_native_cursor_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698