| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/utility/screenshot_controller.h" | 5 #include "ash/utility/screenshot_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "ash/common/shell_window_ids.h" | 9 #include "ash/common/shell_window_ids.h" |
| 10 #include "ash/display/mouse_cursor_event_filter.h" | 10 #include "ash/display/mouse_cursor_event_filter.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 } | 329 } |
| 330 Cancel(); | 330 Cancel(); |
| 331 } | 331 } |
| 332 | 332 |
| 333 void ScreenshotController::Cancel() { | 333 void ScreenshotController::Cancel() { |
| 334 mode_ = NONE; | 334 mode_ = NONE; |
| 335 root_window_ = nullptr; | 335 root_window_ = nullptr; |
| 336 SetSelectedWindow(nullptr); | 336 SetSelectedWindow(nullptr); |
| 337 screenshot_delegate_ = nullptr; | 337 screenshot_delegate_ = nullptr; |
| 338 display::Screen::GetScreen()->RemoveObserver(this); | 338 display::Screen::GetScreen()->RemoveObserver(this); |
| 339 STLDeleteValues(&layers_); | 339 base::STLDeleteValues(&layers_); |
| 340 cursor_setter_.reset(); | 340 cursor_setter_.reset(); |
| 341 EnableMouseWarp(true); | 341 EnableMouseWarp(true); |
| 342 } | 342 } |
| 343 | 343 |
| 344 void ScreenshotController::Update(const ui::LocatedEvent& event) { | 344 void ScreenshotController::Update(const ui::LocatedEvent& event) { |
| 345 // Update may happen without MaybeStart() if the partial screenshot session | 345 // Update may happen without MaybeStart() if the partial screenshot session |
| 346 // starts when dragging. | 346 // starts when dragging. |
| 347 if (!root_window_) | 347 if (!root_window_) |
| 348 MaybeStart(event); | 348 MaybeStart(event); |
| 349 DCHECK(layers_.find(root_window_) != layers_.end()); | 349 DCHECK(layers_.find(root_window_) != layers_.end()); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 | 503 |
| 504 void ScreenshotController::OnDisplayMetricsChanged( | 504 void ScreenshotController::OnDisplayMetricsChanged( |
| 505 const display::Display& display, | 505 const display::Display& display, |
| 506 uint32_t changed_metrics) {} | 506 uint32_t changed_metrics) {} |
| 507 | 507 |
| 508 void ScreenshotController::OnWindowDestroying(aura::Window* window) { | 508 void ScreenshotController::OnWindowDestroying(aura::Window* window) { |
| 509 SetSelectedWindow(nullptr); | 509 SetSelectedWindow(nullptr); |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace ash | 512 } // namespace ash |
| OLD | NEW |