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

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: fix win_aura 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
« no previous file with comments | « ash/display/mouse_cursor_event_filter_unittest.cc ('k') | ash/shell.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 (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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 show 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->DisableMouseEvents();
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->EnableMouseEvents();
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 //////////////////////////////////////////////////////////////////////////////// 526 ////////////////////////////////////////////////////////////////////////////////
527 // MagnificationController: 527 // MagnificationController:
528 528
529 // static 529 // static
530 MagnificationController* MagnificationController::CreateInstance() { 530 MagnificationController* MagnificationController::CreateInstance() {
531 return new MagnificationControllerImpl(); 531 return new MagnificationControllerImpl();
532 } 532 }
533 533
534 } // namespace ash 534 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/mouse_cursor_event_filter_unittest.cc ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698