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

Side by Side Diff: ash/magnifier/magnification_controller.cc

Issue 11412315: Make the cursor have separate mode for disabled mouse events and invisible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years 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/magnifier/magnification_controller.h" 5 #include "ash/magnifier/magnification_controller.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_delegate.h" 8 #include "ash/shell_delegate.h"
9 #include "ash/system/tray/system_tray_delegate.h" 9 #include "ash/system/tray/system_tray_delegate.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 AfterAnimationMoveCursorTo(mouse); 332 AfterAnimationMoveCursorTo(mouse);
333 } 333 }
334 } 334 }
335 } 335 }
336 336
337 void MagnificationControllerImpl::AfterAnimationMoveCursorTo( 337 void MagnificationControllerImpl::AfterAnimationMoveCursorTo(
338 const gfx::Point& location) { 338 const gfx::Point& location) {
339 aura::client::CursorClient* cursor_client = 339 aura::client::CursorClient* cursor_client =
340 aura::client::GetCursorClient(root_window_); 340 aura::client::GetCursorClient(root_window_);
341 if (cursor_client) { 341 if (cursor_client) {
342 // When cursor is invisible, do not move or show the cursor after the 342 // When cursor is invisible, do not move or enable the cursor after the
343 // animation. 343 // animation.
344 if (!cursor_client->IsCursorVisible()) 344 if (!cursor_client->IsCursorVisible())
345 return; 345 return;
346 cursor_client->ShowCursor(false); 346 cursor_client->EnableCursor(false);
347 } 347 }
348 move_cursor_after_animation_ = true; 348 move_cursor_after_animation_ = true;
349 position_after_animation_ = location; 349 position_after_animation_ = location;
350 } 350 }
351 351
352 gfx::Size MagnificationControllerImpl::GetHostSizeDIP() const { 352 gfx::Size MagnificationControllerImpl::GetHostSizeDIP() const {
353 return ui::ConvertSizeToDIP(root_window_->layer(), 353 return ui::ConvertSizeToDIP(root_window_->layer(),
354 root_window_->GetHostSize()); 354 root_window_->GetHostSize());
355 } 355 }
356 356
(...skipping 29 matching lines...) Expand all
386 if (!is_on_animation_) 386 if (!is_on_animation_)
387 return; 387 return;
388 388
389 if (move_cursor_after_animation_) { 389 if (move_cursor_after_animation_) {
390 root_window_->MoveCursorTo(position_after_animation_); 390 root_window_->MoveCursorTo(position_after_animation_);
391 move_cursor_after_animation_ = false; 391 move_cursor_after_animation_ = false;
392 392
393 aura::client::CursorClient* cursor_client = 393 aura::client::CursorClient* cursor_client =
394 aura::client::GetCursorClient(root_window_); 394 aura::client::GetCursorClient(root_window_);
395 if (cursor_client) 395 if (cursor_client)
396 cursor_client->ShowCursor(true); 396 cursor_client->EnableCursor(true);
397 } 397 }
398 398
399 is_on_animation_ = false; 399 is_on_animation_ = false;
400 } 400 }
401 401
402 void MagnificationControllerImpl::SwitchTargetRootWindow( 402 void MagnificationControllerImpl::SwitchTargetRootWindow(
403 aura::RootWindow* new_root_window) { 403 aura::RootWindow* new_root_window) {
404 if (new_root_window == root_window_) 404 if (new_root_window == root_window_)
405 return; 405 return;
406 406
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 528
529 //////////////////////////////////////////////////////////////////////////////// 529 ////////////////////////////////////////////////////////////////////////////////
530 // MagnificationController: 530 // MagnificationController:
531 531
532 // static 532 // static
533 MagnificationController* MagnificationController::CreateInstance() { 533 MagnificationController* MagnificationController::CreateInstance() {
534 return new MagnificationControllerImpl(); 534 return new MagnificationControllerImpl();
535 } 535 }
536 536
537 } // namespace ash 537 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698