| OLD | NEW |
| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 AfterAnimationMoveCursorTo(mouse); | 347 AfterAnimationMoveCursorTo(mouse); |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 } | 350 } |
| 351 | 351 |
| 352 void MagnificationControllerImpl::AfterAnimationMoveCursorTo( | 352 void MagnificationControllerImpl::AfterAnimationMoveCursorTo( |
| 353 const gfx::Point& location) { | 353 const gfx::Point& location) { |
| 354 aura::client::CursorClient* cursor_client = | 354 aura::client::CursorClient* cursor_client = |
| 355 aura::client::GetCursorClient(root_window_); | 355 aura::client::GetCursorClient(root_window_); |
| 356 if (cursor_client) { | 356 if (cursor_client) { |
| 357 // When cursor is invisible, do not move or show the cursor after the | 357 // When cursor is invisible, do not move or enable the cursor after the |
| 358 // animation. | 358 // animation. |
| 359 if (!cursor_client->IsCursorVisible()) | 359 if (!cursor_client->IsCursorVisible()) |
| 360 return; | 360 return; |
| 361 cursor_client->ShowCursor(false); | 361 cursor_client->EnableCursor(false); |
| 362 } | 362 } |
| 363 move_cursor_after_animation_ = true; | 363 move_cursor_after_animation_ = true; |
| 364 position_after_animation_ = location; | 364 position_after_animation_ = location; |
| 365 } | 365 } |
| 366 | 366 |
| 367 gfx::Size MagnificationControllerImpl::GetHostSizeDIP() const { | 367 gfx::Size MagnificationControllerImpl::GetHostSizeDIP() const { |
| 368 return ui::ConvertSizeToDIP(root_window_->layer(), | 368 return ui::ConvertSizeToDIP(root_window_->layer(), |
| 369 root_window_->GetHostSize()); | 369 root_window_->GetHostSize()); |
| 370 } | 370 } |
| 371 | 371 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 401 if (!is_on_animation_) | 401 if (!is_on_animation_) |
| 402 return; | 402 return; |
| 403 | 403 |
| 404 if (move_cursor_after_animation_) { | 404 if (move_cursor_after_animation_) { |
| 405 root_window_->MoveCursorTo(position_after_animation_); | 405 root_window_->MoveCursorTo(position_after_animation_); |
| 406 move_cursor_after_animation_ = false; | 406 move_cursor_after_animation_ = false; |
| 407 | 407 |
| 408 aura::client::CursorClient* cursor_client = | 408 aura::client::CursorClient* cursor_client = |
| 409 aura::client::GetCursorClient(root_window_); | 409 aura::client::GetCursorClient(root_window_); |
| 410 if (cursor_client) | 410 if (cursor_client) |
| 411 cursor_client->ShowCursor(true); | 411 cursor_client->EnableCursor(true); |
| 412 } | 412 } |
| 413 | 413 |
| 414 is_on_animation_ = false; | 414 is_on_animation_ = false; |
| 415 } | 415 } |
| 416 | 416 |
| 417 void MagnificationControllerImpl::SwitchTargetRootWindow( | 417 void MagnificationControllerImpl::SwitchTargetRootWindow( |
| 418 aura::RootWindow* new_root_window) { | 418 aura::RootWindow* new_root_window) { |
| 419 if (new_root_window == root_window_) | 419 if (new_root_window == root_window_) |
| 420 return; | 420 return; |
| 421 | 421 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 | 533 |
| 534 //////////////////////////////////////////////////////////////////////////////// | 534 //////////////////////////////////////////////////////////////////////////////// |
| 535 // MagnificationController: | 535 // MagnificationController: |
| 536 | 536 |
| 537 // static | 537 // static |
| 538 MagnificationController* MagnificationController::CreateInstance() { | 538 MagnificationController* MagnificationController::CreateInstance() { |
| 539 return new MagnificationControllerImpl(); | 539 return new MagnificationControllerImpl(); |
| 540 } | 540 } |
| 541 | 541 |
| 542 } // namespace ash | 542 } // namespace ash |
| OLD | NEW |