| 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/wm/overview/window_grid.h" | 5 #include "ash/wm/overview/window_grid.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "ash/ash_switches.h" | 13 #include "ash/ash_switches.h" |
| 14 #include "ash/public/cpp/shelf_types.h" | 14 #include "ash/public/cpp/shelf_types.h" |
| 15 #include "ash/public/cpp/shell_window_ids.h" | 15 #include "ash/public/cpp/shell_window_ids.h" |
| 16 #include "ash/root_window_controller.h" | 16 #include "ash/root_window_controller.h" |
| 17 #include "ash/screen_util.h" | 17 #include "ash/screen_util.h" |
| 18 #include "ash/shelf/wm_shelf.h" | 18 #include "ash/shelf/shelf.h" |
| 19 #include "ash/wm/overview/cleanup_animation_observer.h" | 19 #include "ash/wm/overview/cleanup_animation_observer.h" |
| 20 #include "ash/wm/overview/scoped_overview_animation_settings.h" | 20 #include "ash/wm/overview/scoped_overview_animation_settings.h" |
| 21 #include "ash/wm/overview/scoped_overview_animation_settings_factory.h" | 21 #include "ash/wm/overview/scoped_overview_animation_settings_factory.h" |
| 22 #include "ash/wm/overview/window_selector.h" | 22 #include "ash/wm/overview/window_selector.h" |
| 23 #include "ash/wm/overview/window_selector_delegate.h" | 23 #include "ash/wm/overview/window_selector_delegate.h" |
| 24 #include "ash/wm/overview/window_selector_item.h" | 24 #include "ash/wm/overview/window_selector_item.h" |
| 25 #include "ash/wm/window_state.h" | 25 #include "ash/wm/window_state.h" |
| 26 #include "ash/wm_window.h" | 26 #include "ash/wm_window.h" |
| 27 #include "base/command_line.h" | 27 #include "base/command_line.h" |
| 28 #include "base/i18n/string_search.h" | 28 #include "base/i18n/string_search.h" |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 (*iter)->OnMinimizedStateChanged(); | 634 (*iter)->OnMinimizedStateChanged(); |
| 635 PositionWindows(false); | 635 PositionWindows(false); |
| 636 } | 636 } |
| 637 } | 637 } |
| 638 | 638 |
| 639 void WindowGrid::InitShieldWidget() { | 639 void WindowGrid::InitShieldWidget() { |
| 640 // TODO(varkha): The code assumes that SHELF_BACKGROUND_MAXIMIZED is | 640 // TODO(varkha): The code assumes that SHELF_BACKGROUND_MAXIMIZED is |
| 641 // synonymous with a black shelf background. Update this code if that | 641 // synonymous with a black shelf background. Update this code if that |
| 642 // assumption is no longer valid. | 642 // assumption is no longer valid. |
| 643 const float initial_opacity = | 643 const float initial_opacity = |
| 644 (WmShelf::ForWindow(root_window_->aura_window())->GetBackgroundType() == | 644 (Shelf::ForWindow(root_window_->aura_window())->GetBackgroundType() == |
| 645 SHELF_BACKGROUND_MAXIMIZED) | 645 SHELF_BACKGROUND_MAXIMIZED) |
| 646 ? 1.f | 646 ? 1.f |
| 647 : 0.f; | 647 : 0.f; |
| 648 shield_widget_.reset( | 648 shield_widget_.reset( |
| 649 CreateBackgroundWidget(root_window_, ui::LAYER_SOLID_COLOR, kShieldColor, | 649 CreateBackgroundWidget(root_window_, ui::LAYER_SOLID_COLOR, kShieldColor, |
| 650 0, 0, SK_ColorTRANSPARENT, initial_opacity)); | 650 0, 0, SK_ColorTRANSPARENT, initial_opacity)); |
| 651 WmWindow* widget_window = WmWindow::Get(shield_widget_->GetNativeWindow()); | 651 WmWindow* widget_window = WmWindow::Get(shield_widget_->GetNativeWindow()); |
| 652 const gfx::Rect bounds = widget_window->GetParent()->GetBounds(); | 652 const gfx::Rect bounds = widget_window->GetParent()->GetBounds(); |
| 653 widget_window->SetBounds(bounds); | 653 widget_window->SetBounds(bounds); |
| 654 widget_window->aura_window()->SetName("OverviewModeShield"); | 654 widget_window->aura_window()->SetName("OverviewModeShield"); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 *min_right = left; | 834 *min_right = left; |
| 835 if (*max_right < left) | 835 if (*max_right < left) |
| 836 *max_right = left; | 836 *max_right = left; |
| 837 } | 837 } |
| 838 *max_bottom = top + height; | 838 *max_bottom = top + height; |
| 839 } | 839 } |
| 840 return windows_fit; | 840 return windows_fit; |
| 841 } | 841 } |
| 842 | 842 |
| 843 } // namespace ash | 843 } // namespace ash |
| OLD | NEW |