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

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

Issue 2654153002: [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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 void ScopedTransformOverviewWindow::SetImmediateCloseForTests() { 438 void ScopedTransformOverviewWindow::SetImmediateCloseForTests() {
439 immediate_close_for_tests = true; 439 immediate_close_for_tests = true;
440 } 440 }
441 441
442 WmWindow* ScopedTransformOverviewWindow::GetOverviewWindow() const { 442 WmWindow* ScopedTransformOverviewWindow::GetOverviewWindow() const {
443 if (minimized_widget_) 443 if (minimized_widget_)
444 return GetOverviewWindowForMinimizedState(); 444 return GetOverviewWindowForMinimizedState();
445 return window_; 445 return window_;
446 } 446 }
447 447
448 void ScopedTransformOverviewWindow::EnsureVisible() {
449 original_opacity_ = 1.f;
450 }
451
448 void ScopedTransformOverviewWindow::OnGestureEvent(ui::GestureEvent* event) { 452 void ScopedTransformOverviewWindow::OnGestureEvent(ui::GestureEvent* event) {
449 if (event->type() == ui::ET_GESTURE_TAP) { 453 if (event->type() == ui::ET_GESTURE_TAP) {
454 EnsureVisible();
450 window_->Show(); 455 window_->Show();
451 window_->Activate(); 456 window_->Activate();
452 } 457 }
453 } 458 }
454 459
455 void ScopedTransformOverviewWindow::OnMouseEvent(ui::MouseEvent* event) { 460 void ScopedTransformOverviewWindow::OnMouseEvent(ui::MouseEvent* event) {
456 if (event->type() == ui::ET_MOUSE_PRESSED && event->IsOnlyLeftMouseButton()) { 461 if (event->type() == ui::ET_MOUSE_PRESSED && event->IsOnlyLeftMouseButton()) {
462 EnsureVisible();
457 window_->Show(); 463 window_->Show();
458 window_->Activate(); 464 window_->Activate();
459 } 465 }
460 } 466 }
461 467
462 WmWindow* ScopedTransformOverviewWindow::GetOverviewWindowForMinimizedState() 468 WmWindow* ScopedTransformOverviewWindow::GetOverviewWindowForMinimizedState()
463 const { 469 const {
464 return minimized_widget_ 470 return minimized_widget_
465 ? WmLookup::Get()->GetWindowForWidget(minimized_widget_.get()) 471 ? WmLookup::Get()->GetWindowForWidget(minimized_widget_.get())
466 : nullptr; 472 : nullptr;
(...skipping 26 matching lines...) Expand all
493 // In unit tests, the content view can have empty size. 499 // In unit tests, the content view can have empty size.
494 if (!preferred.IsEmpty()) { 500 if (!preferred.IsEmpty()) {
495 int inset = bounds.height() - preferred.height(); 501 int inset = bounds.height() - preferred.height();
496 bounds.Inset(0, 0, 0, inset); 502 bounds.Inset(0, 0, 0, inset);
497 } 503 }
498 minimized_widget_->SetBounds(bounds); 504 minimized_widget_->SetBounds(bounds);
499 minimized_widget_->Show(); 505 minimized_widget_->Show();
500 } 506 }
501 507
502 } // namespace ash 508 } // 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