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 "ui/aura/event_filter.h" | 8 #include "ui/aura/event_filter.h" |
9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
10 #include "ui/aura/shared/compound_event_filter.h" | 10 #include "ui/aura/shared/compound_event_filter.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 if (start_zoom && !is_on_zooming_) { | 288 if (start_zoom && !is_on_zooming_) { |
289 bool ret = RedrawDIP(gfx::Point(x, y), scale_, true); | 289 bool ret = RedrawDIP(gfx::Point(x, y), scale_, true); |
290 | 290 |
291 if (ret) { | 291 if (ret) { |
292 is_on_zooming_ = true; | 292 is_on_zooming_ = true; |
293 | 293 |
294 int x_diff = origin_.x() - window_rect.x(); | 294 int x_diff = origin_.x() - window_rect.x(); |
295 int y_diff = origin_.y() - window_rect.y(); | 295 int y_diff = origin_.y() - window_rect.y(); |
296 // If the magnified region is moved, hides the mouse cursor and moves it. | 296 // If the magnified region is moved, hides the mouse cursor and moves it. |
297 if (x_diff != 0 || y_diff != 0) { | 297 if (x_diff != 0 || y_diff != 0) { |
298 ash::Shell::GetInstance()-> | |
299 env_filter()->set_update_cursor_visibility(false); | |
300 root_window_->ShowCursor(false); | 298 root_window_->ShowCursor(false); |
301 mouse.set_x(mouse.x() - (origin_.x() - window_rect.x())); | 299 mouse.set_x(mouse.x() - (origin_.x() - window_rect.x())); |
302 mouse.set_y(mouse.y() - (origin_.y() - window_rect.y())); | 300 mouse.set_y(mouse.y() - (origin_.y() - window_rect.y())); |
303 root_window_->MoveCursorTo(mouse); | 301 root_window_->MoveCursorTo(mouse); |
304 } | 302 } |
305 } | 303 } |
306 } | 304 } |
307 } | 305 } |
308 | 306 |
309 gfx::Size MagnificationControllerImpl::GetHostSizeDIP() const { | 307 gfx::Size MagnificationControllerImpl::GetHostSizeDIP() const { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 //////////////////////////////////////////////////////////////////////////////// | 459 //////////////////////////////////////////////////////////////////////////////// |
462 // MagnificationController: | 460 // MagnificationController: |
463 | 461 |
464 // static | 462 // static |
465 MagnificationController* MagnificationController::CreateInstance() { | 463 MagnificationController* MagnificationController::CreateInstance() { |
466 return new MagnificationControllerImpl(); | 464 return new MagnificationControllerImpl(); |
467 } | 465 } |
468 | 466 |
469 } // namespace internal | 467 } // namespace internal |
470 } // namespace ash | 468 } // namespace ash |
OLD | NEW |