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

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

Issue 160953002: Magnification controller: fix incorrect point of interest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Go back to patch set #1. Let's refactor has_valid_location separately. Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | 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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698