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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 380 |
381 void ScreenshotController::UpdateSelectedWindow(ui::LocatedEvent* event) { | 381 void ScreenshotController::UpdateSelectedWindow(ui::LocatedEvent* event) { |
382 aura::Window* selected = ScreenshotWindowTargeter().FindWindowForEvent(event); | 382 aura::Window* selected = ScreenshotWindowTargeter().FindWindowForEvent(event); |
383 | 383 |
384 // Find a window that is backed with a widget. | 384 // Find a window that is backed with a widget. |
385 while (selected && (selected->type() == ui::wm::WINDOW_TYPE_CONTROL || | 385 while (selected && (selected->type() == ui::wm::WINDOW_TYPE_CONTROL || |
386 !selected->delegate())) { | 386 !selected->delegate())) { |
387 selected = selected->parent(); | 387 selected = selected->parent(); |
388 } | 388 } |
389 | 389 |
390 if (selected->parent()->id() == kShellWindowId_DesktopBackgroundContainer || | 390 if (selected->parent()->id() == kShellWindowId_WallpaperContainer || |
391 selected->parent()->id() == kShellWindowId_LockScreenBackgroundContainer) | 391 selected->parent()->id() == kShellWindowId_LockScreenWallpaperContainer) |
392 selected = nullptr; | 392 selected = nullptr; |
393 | 393 |
394 SetSelectedWindow(selected); | 394 SetSelectedWindow(selected); |
395 } | 395 } |
396 | 396 |
397 void ScreenshotController::SetSelectedWindow(aura::Window* selected) { | 397 void ScreenshotController::SetSelectedWindow(aura::Window* selected) { |
398 if (selected_ == selected) | 398 if (selected_ == selected) |
399 return; | 399 return; |
400 | 400 |
401 if (selected_) { | 401 if (selected_) { |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 | 534 |
535 void ScreenshotController::OnDisplayMetricsChanged( | 535 void ScreenshotController::OnDisplayMetricsChanged( |
536 const display::Display& display, | 536 const display::Display& display, |
537 uint32_t changed_metrics) {} | 537 uint32_t changed_metrics) {} |
538 | 538 |
539 void ScreenshotController::OnWindowDestroying(aura::Window* window) { | 539 void ScreenshotController::OnWindowDestroying(aura::Window* window) { |
540 SetSelectedWindow(nullptr); | 540 SetSelectedWindow(nullptr); |
541 } | 541 } |
542 | 542 |
543 } // namespace ash | 543 } // namespace ash |
OLD | NEW |