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_overview.h" | 5 #include "ash/wm/overview/window_overview.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/accessibility_delegate.h" | 9 #include "ash/accessibility_delegate.h" |
10 #include "ash/metrics/user_metrics_recorder.h" | 10 #include "ash/metrics/user_metrics_recorder.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 window_size.height()); | 420 window_size.height()); |
421 target_bounds.Inset(kWindowMargin, kWindowMargin); | 421 target_bounds.Inset(kWindowMargin, kWindowMargin); |
422 windows[i]->SetBounds(root_window, target_bounds, animate); | 422 windows[i]->SetBounds(root_window, target_bounds, animate); |
423 } | 423 } |
424 } | 424 } |
425 | 425 |
426 void WindowOverview::InitializeSelectionWidget() { | 426 void WindowOverview::InitializeSelectionWidget() { |
427 selection_widget_.reset(new views::Widget); | 427 selection_widget_.reset(new views::Widget); |
428 views::Widget::InitParams params; | 428 views::Widget::InitParams params; |
429 params.type = views::Widget::InitParams::TYPE_POPUP; | 429 params.type = views::Widget::InitParams::TYPE_POPUP; |
430 params.can_activate = false; | |
431 params.keep_on_top = false; | 430 params.keep_on_top = false; |
432 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 431 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
433 params.opacity = views::Widget::InitParams::OPAQUE_WINDOW; | 432 params.opacity = views::Widget::InitParams::OPAQUE_WINDOW; |
434 params.parent = Shell::GetContainer(windows_->front()->GetRootWindow(), | 433 params.parent = Shell::GetContainer(windows_->front()->GetRootWindow(), |
435 kShellWindowId_DefaultContainer); | 434 kShellWindowId_DefaultContainer); |
436 params.accept_events = false; | 435 params.accept_events = false; |
437 selection_widget_->set_focus_on_creation(false); | 436 selection_widget_->set_focus_on_creation(false); |
438 selection_widget_->Init(params); | 437 selection_widget_->Init(params); |
439 views::View* content_view = new views::View; | 438 views::View* content_view = new views::View; |
440 content_view->set_background( | 439 content_view->set_background( |
441 views::Background::CreateSolidBackground(kWindowOverviewSelectionColor)); | 440 views::Background::CreateSolidBackground(kWindowOverviewSelectionColor)); |
442 selection_widget_->SetContentsView(content_view); | 441 selection_widget_->SetContentsView(content_view); |
443 selection_widget_->Show(); | 442 selection_widget_->Show(); |
444 selection_widget_->GetNativeWindow()->parent()->StackChildAtBottom( | 443 selection_widget_->GetNativeWindow()->parent()->StackChildAtBottom( |
445 selection_widget_->GetNativeWindow()); | 444 selection_widget_->GetNativeWindow()); |
446 selection_widget_->GetNativeWindow()->layer()->SetOpacity( | 445 selection_widget_->GetNativeWindow()->layer()->SetOpacity( |
447 kWindowOverviewSelectionOpacity); | 446 kWindowOverviewSelectionOpacity); |
448 } | 447 } |
449 | 448 |
450 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { | 449 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { |
451 gfx::Rect bounds((*windows_)[index]->bounds()); | 450 gfx::Rect bounds((*windows_)[index]->bounds()); |
452 bounds.Inset(-kWindowOverviewSelectionPadding, | 451 bounds.Inset(-kWindowOverviewSelectionPadding, |
453 -kWindowOverviewSelectionPadding); | 452 -kWindowOverviewSelectionPadding); |
454 return bounds; | 453 return bounds; |
455 } | 454 } |
456 | 455 |
457 } // namespace ash | 456 } // namespace ash |
OLD | NEW |