| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/wm/overview/window_selector_item.h" | 5 #include "ash/wm/overview/window_selector_item.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/metrics/user_metrics_action.h" | 10 #include "ash/metrics/user_metrics_action.h" |
| 11 #include "ash/public/cpp/shell_window_ids.h" | 11 #include "ash/public/cpp/shell_window_ids.h" |
| 12 #include "ash/resources/vector_icons/vector_icons.h" | 12 #include "ash/resources/vector_icons/vector_icons.h" |
| 13 #include "ash/root_window_controller.h" | 13 #include "ash/root_window_controller.h" |
| 14 #include "ash/shell.h" |
| 14 #include "ash/shell_port.h" | 15 #include "ash/shell_port.h" |
| 16 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 15 #include "ash/wm/overview/cleanup_animation_observer.h" | 17 #include "ash/wm/overview/cleanup_animation_observer.h" |
| 16 #include "ash/wm/overview/overview_animation_type.h" | 18 #include "ash/wm/overview/overview_animation_type.h" |
| 17 #include "ash/wm/overview/scoped_overview_animation_settings.h" | 19 #include "ash/wm/overview/scoped_overview_animation_settings.h" |
| 18 #include "ash/wm/overview/scoped_transform_overview_window.h" | 20 #include "ash/wm/overview/scoped_transform_overview_window.h" |
| 19 #include "ash/wm/overview/window_selector.h" | 21 #include "ash/wm/overview/window_selector.h" |
| 20 #include "ash/wm/overview/window_selector_controller.h" | 22 #include "ash/wm/overview/window_selector_controller.h" |
| 21 #include "ash/wm/window_state.h" | 23 #include "ash/wm/window_state.h" |
| 22 #include "base/auto_reset.h" | 24 #include "base/auto_reset.h" |
| 23 #include "base/strings/string_util.h" | 25 #include "base/strings/string_util.h" |
| 24 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 | 525 |
| 524 void WindowSelectorItem::SetDimmed(bool dimmed) { | 526 void WindowSelectorItem::SetDimmed(bool dimmed) { |
| 525 dimmed_ = dimmed; | 527 dimmed_ = dimmed; |
| 526 SetOpacity(dimmed ? kDimmedItemOpacity : 1.0f); | 528 SetOpacity(dimmed ? kDimmedItemOpacity : 1.0f); |
| 527 } | 529 } |
| 528 | 530 |
| 529 void WindowSelectorItem::ButtonPressed(views::Button* sender, | 531 void WindowSelectorItem::ButtonPressed(views::Button* sender, |
| 530 const ui::Event& event) { | 532 const ui::Event& event) { |
| 531 if (sender == close_button_) { | 533 if (sender == close_button_) { |
| 532 ShellPort::Get()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW_CLOSE_BUTTON); | 534 ShellPort::Get()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW_CLOSE_BUTTON); |
| 535 if (ash::Shell::Get() |
| 536 ->maximize_mode_controller() |
| 537 ->IsMaximizeModeWindowManagerEnabled()) { |
| 538 ash::ShellPort::Get()->RecordUserMetricsAction( |
| 539 ash::UMA_TABLET_WINDOW_CLOSE_THROUGH_OVERVIEW_CLOSE_BUTTON); |
| 540 } |
| 533 CloseWindow(); | 541 CloseWindow(); |
| 534 return; | 542 return; |
| 535 } | 543 } |
| 536 CHECK(sender == caption_container_view_->listener_button()); | 544 CHECK(sender == caption_container_view_->listener_button()); |
| 537 window_selector_->SelectWindow(this); | 545 window_selector_->SelectWindow(this); |
| 538 } | 546 } |
| 539 | 547 |
| 540 void WindowSelectorItem::OnWindowDestroying(aura::Window* window) { | 548 void WindowSelectorItem::OnWindowDestroying(aura::Window* window) { |
| 541 window->RemoveObserver(this); | 549 window->RemoveObserver(this); |
| 542 transform_window_.OnWindowDestroyed(); | 550 transform_window_.OnWindowDestroyed(); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 749 |
| 742 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { | 750 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { |
| 743 return background_view_ ? background_view_->animation() : nullptr; | 751 return background_view_ ? background_view_->animation() : nullptr; |
| 744 } | 752 } |
| 745 | 753 |
| 746 aura::Window* WindowSelectorItem::GetOverviewWindowForMinimizedStateForTest() { | 754 aura::Window* WindowSelectorItem::GetOverviewWindowForMinimizedStateForTest() { |
| 747 return transform_window_.GetOverviewWindowForMinimizedState(); | 755 return transform_window_.GetOverviewWindowForMinimizedState(); |
| 748 } | 756 } |
| 749 | 757 |
| 750 } // namespace ash | 758 } // namespace ash |
| OLD | NEW |