Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: ash/common/wm/overview/window_grid.cc

Issue 2799993003: Removes couple of methods from WmWindow (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/wm/overview/window_grid.h" 5 #include "ash/common/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>
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 for (const auto& window_item : window_list_) { 532 for (const auto& window_item : window_list_) {
533 if (window_item->Contains(window)) 533 if (window_item->Contains(window))
534 return true; 534 return true;
535 } 535 }
536 return false; 536 return false;
537 } 537 }
538 538
539 void WindowGrid::FilterItems(const base::string16& pattern) { 539 void WindowGrid::FilterItems(const base::string16& pattern) {
540 base::i18n::FixedPatternStringSearchIgnoringCaseAndAccents finder(pattern); 540 base::i18n::FixedPatternStringSearchIgnoringCaseAndAccents finder(pattern);
541 for (const auto& window : window_list_) { 541 for (const auto& window : window_list_) {
542 if (finder.Search(window->GetWindow()->GetTitle(), nullptr, nullptr)) { 542 if (finder.Search(window->GetWindow()->aura_window()->GetTitle(), nullptr,
543 nullptr)) {
543 window->SetDimmed(false); 544 window->SetDimmed(false);
544 } else { 545 } else {
545 window->SetDimmed(true); 546 window->SetDimmed(true);
546 if (selection_widget_ && SelectedWindow() == window.get()) { 547 if (selection_widget_ && SelectedWindow() == window.get()) {
547 SelectedWindow()->SetSelected(false); 548 SelectedWindow()->SetSelected(false);
548 selection_widget_.reset(); 549 selection_widget_.reset();
549 selector_shadow_.reset(); 550 selector_shadow_.reset();
550 } 551 }
551 } 552 }
552 } 553 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 (WmShelf::ForWindow(root_window_)->GetBackgroundType() == 645 (WmShelf::ForWindow(root_window_)->GetBackgroundType() ==
645 SHELF_BACKGROUND_MAXIMIZED) 646 SHELF_BACKGROUND_MAXIMIZED)
646 ? 1.f 647 ? 1.f
647 : 0.f; 648 : 0.f;
648 shield_widget_.reset( 649 shield_widget_.reset(
649 CreateBackgroundWidget(root_window_, ui::LAYER_SOLID_COLOR, kShieldColor, 650 CreateBackgroundWidget(root_window_, ui::LAYER_SOLID_COLOR, kShieldColor,
650 0, 0, SK_ColorTRANSPARENT, initial_opacity)); 651 0, 0, SK_ColorTRANSPARENT, initial_opacity));
651 WmWindow* widget_window = WmWindow::Get(shield_widget_->GetNativeWindow()); 652 WmWindow* widget_window = WmWindow::Get(shield_widget_->GetNativeWindow());
652 const gfx::Rect bounds = widget_window->GetParent()->GetBounds(); 653 const gfx::Rect bounds = widget_window->GetParent()->GetBounds();
653 widget_window->SetBounds(bounds); 654 widget_window->SetBounds(bounds);
654 widget_window->SetName("OverviewModeShield"); 655 widget_window->aura_window()->SetName("OverviewModeShield");
655 656
656 ui::ScopedLayerAnimationSettings animation_settings( 657 ui::ScopedLayerAnimationSettings animation_settings(
657 widget_window->GetLayer()->GetAnimator()); 658 widget_window->GetLayer()->GetAnimator());
658 animation_settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds( 659 animation_settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
659 kOverviewSelectorTransitionMilliseconds)); 660 kOverviewSelectorTransitionMilliseconds));
660 animation_settings.SetTweenType(gfx::Tween::EASE_OUT); 661 animation_settings.SetTweenType(gfx::Tween::EASE_OUT);
661 animation_settings.SetPreemptionStrategy( 662 animation_settings.SetPreemptionStrategy(
662 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 663 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
663 shield_widget_->SetOpacity(kShieldOpacity); 664 shield_widget_->SetOpacity(kShieldOpacity);
664 } 665 }
665 666
666 void WindowGrid::InitSelectionWidget(WindowSelector::Direction direction) { 667 void WindowGrid::InitSelectionWidget(WindowSelector::Direction direction) {
667 selection_widget_.reset(CreateBackgroundWidget( 668 selection_widget_.reset(CreateBackgroundWidget(
668 root_window_, ui::LAYER_TEXTURED, kWindowSelectionColor, 669 root_window_, ui::LAYER_TEXTURED, kWindowSelectionColor,
669 kWindowSelectionBorderThickness, kWindowSelectionRadius, 670 kWindowSelectionBorderThickness, kWindowSelectionRadius,
670 kWindowSelectionBorderColor, 0.f)); 671 kWindowSelectionBorderColor, 0.f));
671 WmWindow* widget_window = WmWindow::Get(selection_widget_->GetNativeWindow()); 672 WmWindow* widget_window = WmWindow::Get(selection_widget_->GetNativeWindow());
672 const gfx::Rect target_bounds = 673 const gfx::Rect target_bounds =
673 root_window_->ConvertRectFromScreen(SelectedWindow()->target_bounds()); 674 root_window_->ConvertRectFromScreen(SelectedWindow()->target_bounds());
674 gfx::Vector2d fade_out_direction = 675 gfx::Vector2d fade_out_direction =
675 GetSlideVectorForFadeIn(direction, target_bounds); 676 GetSlideVectorForFadeIn(direction, target_bounds);
676 widget_window->SetBounds(target_bounds - fade_out_direction); 677 widget_window->SetBounds(target_bounds - fade_out_direction);
677 widget_window->SetName("OverviewModeSelector"); 678 widget_window->aura_window()->SetName("OverviewModeSelector");
678 679
679 selector_shadow_.reset(new ::wm::Shadow()); 680 selector_shadow_.reset(new ::wm::Shadow());
680 selector_shadow_->Init(::wm::ShadowElevation::LARGE); 681 selector_shadow_->Init(::wm::ShadowElevation::LARGE);
681 selector_shadow_->layer()->SetVisible(true); 682 selector_shadow_->layer()->SetVisible(true);
682 selection_widget_->GetLayer()->SetMasksToBounds(false); 683 selection_widget_->GetLayer()->SetMasksToBounds(false);
683 selection_widget_->GetLayer()->Add(selector_shadow_->layer()); 684 selection_widget_->GetLayer()->Add(selector_shadow_->layer());
684 selector_shadow_->SetContentBounds(gfx::Rect(target_bounds.size())); 685 selector_shadow_->SetContentBounds(gfx::Rect(target_bounds.size()));
685 } 686 }
686 687
687 void WindowGrid::MoveSelectionWidget(WindowSelector::Direction direction, 688 void WindowGrid::MoveSelectionWidget(WindowSelector::Direction direction,
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 *min_right = left; 835 *min_right = left;
835 if (*max_right < left) 836 if (*max_right < left)
836 *max_right = left; 837 *max_right = left;
837 } 838 }
838 *max_bottom = top + height; 839 *max_bottom = top + height;
839 } 840 }
840 return windows_fit; 841 return windows_fit;
841 } 842 }
842 843
843 } // namespace ash 844 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/devtools/ash_devtools_unittest.cc ('k') | ash/common/wm/overview/window_selector_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698