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

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

Issue 2657453003: [ash-md] Makes sure that minimized windows can be activated in overview (Closed)
Patch Set: Created 3 years, 11 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 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/common/wm/overview/scoped_transform_overview_window.h" 5 #include "ash/common/wm/overview/scoped_transform_overview_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/wm/overview/scoped_overview_animation_settings.h" 10 #include "ash/common/wm/overview/scoped_overview_animation_settings.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 void ScopedTransformOverviewWindow::SetImmediateCloseForTests() { 439 void ScopedTransformOverviewWindow::SetImmediateCloseForTests() {
440 immediate_close_for_tests = true; 440 immediate_close_for_tests = true;
441 } 441 }
442 442
443 WmWindow* ScopedTransformOverviewWindow::GetOverviewWindow() const { 443 WmWindow* ScopedTransformOverviewWindow::GetOverviewWindow() const {
444 if (minimized_widget_) 444 if (minimized_widget_)
445 return GetOverviewWindowForMinimizedState(); 445 return GetOverviewWindowForMinimizedState();
446 return window_; 446 return window_;
447 } 447 }
448 448
449 void ScopedTransformOverviewWindow::EnsureVisible() {
450 original_opacity_ = 1.f;
451 }
452
449 void ScopedTransformOverviewWindow::OnGestureEvent(ui::GestureEvent* event) { 453 void ScopedTransformOverviewWindow::OnGestureEvent(ui::GestureEvent* event) {
450 if (event->type() == ui::ET_GESTURE_TAP) { 454 if (event->type() == ui::ET_GESTURE_TAP) {
455 EnsureVisible();
451 window_->Show(); 456 window_->Show();
452 window_->Activate(); 457 window_->Activate();
453 } 458 }
454 } 459 }
455 460
456 void ScopedTransformOverviewWindow::OnMouseEvent(ui::MouseEvent* event) { 461 void ScopedTransformOverviewWindow::OnMouseEvent(ui::MouseEvent* event) {
457 if (event->type() == ui::ET_MOUSE_PRESSED && event->IsOnlyLeftMouseButton()) { 462 if (event->type() == ui::ET_MOUSE_PRESSED && event->IsOnlyLeftMouseButton()) {
463 EnsureVisible();
458 window_->Show(); 464 window_->Show();
459 window_->Activate(); 465 window_->Activate();
460 } 466 }
461 } 467 }
462 468
463 WmWindow* ScopedTransformOverviewWindow::GetOverviewWindowForMinimizedState() 469 WmWindow* ScopedTransformOverviewWindow::GetOverviewWindowForMinimizedState()
464 const { 470 const {
465 return minimized_widget_ 471 return minimized_widget_
466 ? WmLookup::Get()->GetWindowForWidget(minimized_widget_.get()) 472 ? WmLookup::Get()->GetWindowForWidget(minimized_widget_.get())
467 : nullptr; 473 : nullptr;
(...skipping 26 matching lines...) Expand all
494 // In unit tests, the content view can have empty size. 500 // In unit tests, the content view can have empty size.
495 if (!preferred.IsEmpty()) { 501 if (!preferred.IsEmpty()) {
496 int inset = bounds.height() - preferred.height(); 502 int inset = bounds.height() - preferred.height();
497 bounds.Inset(0, 0, 0, inset); 503 bounds.Inset(0, 0, 0, inset);
498 } 504 }
499 minimized_widget_->SetBounds(bounds); 505 minimized_widget_->SetBounds(bounds);
500 minimized_widget_->Show(); 506 minimized_widget_->Show();
501 } 507 }
502 508
503 } // namespace ash 509 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/overview/scoped_transform_overview_window.h ('k') | ash/common/wm/overview/window_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698