| 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/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accessibility_delegate.h" | 8 #include "ash/accessibility_delegate.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/display/root_window_transformers.h" | 10 #include "ash/display/root_window_transformers.h" |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 //////////////////////////////////////////////////////////////////////////////// | 547 //////////////////////////////////////////////////////////////////////////////// |
| 548 // MagnificationControllerImpl: aura::EventFilter implementation | 548 // MagnificationControllerImpl: aura::EventFilter implementation |
| 549 | 549 |
| 550 void MagnificationControllerImpl::OnMouseEvent(ui::MouseEvent* event) { | 550 void MagnificationControllerImpl::OnMouseEvent(ui::MouseEvent* event) { |
| 551 aura::Window* target = static_cast<aura::Window*>(event->target()); | 551 aura::Window* target = static_cast<aura::Window*>(event->target()); |
| 552 aura::Window* current_root = target->GetRootWindow(); | 552 aura::Window* current_root = target->GetRootWindow(); |
| 553 gfx::Rect root_bounds = current_root->bounds(); | 553 gfx::Rect root_bounds = current_root->bounds(); |
| 554 | 554 |
| 555 if (root_bounds.Contains(event->root_location())) { | 555 if (root_bounds.Contains(event->root_location())) { |
| 556 // This must be before |SwitchTargetRootWindow()|. | 556 // This must be before |SwitchTargetRootWindow()|. |
| 557 point_of_interest_ = event->root_location(); | 557 if (event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) |
| 558 point_of_interest_ = event->root_location(); |
| 558 | 559 |
| 559 if (current_root != root_window_) { | 560 if (current_root != root_window_) { |
| 560 DCHECK(current_root); | 561 DCHECK(current_root); |
| 561 SwitchTargetRootWindow(current_root, true); | 562 SwitchTargetRootWindow(current_root, true); |
| 562 } | 563 } |
| 563 | 564 |
| 564 if (IsMagnified() && event->type() == ui::ET_MOUSE_MOVED) | 565 if (IsMagnified() && event->type() == ui::ET_MOUSE_MOVED) |
| 565 OnMouseMove(event->root_location()); | 566 OnMouseMove(event->root_location()); |
| 566 } | 567 } |
| 567 } | 568 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 597 | 598 |
| 598 //////////////////////////////////////////////////////////////////////////////// | 599 //////////////////////////////////////////////////////////////////////////////// |
| 599 // MagnificationController: | 600 // MagnificationController: |
| 600 | 601 |
| 601 // static | 602 // static |
| 602 MagnificationController* MagnificationController::CreateInstance() { | 603 MagnificationController* MagnificationController::CreateInstance() { |
| 603 return new MagnificationControllerImpl(); | 604 return new MagnificationControllerImpl(); |
| 604 } | 605 } |
| 605 | 606 |
| 606 } // namespace ash | 607 } // namespace ash |
| OLD | NEW |