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

Side by Side Diff: ash/root_window_controller.cc

Issue 149493008: Use active window if on current workspace for fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only consider the currently active window on current root. Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/root_window_controller.h" 5 #include "ash/root_window_controller.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_constants.h" 10 #include "ash/ash_constants.h"
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 } 565 }
566 566
567 void RootWindowController::UpdateShelfVisibility() { 567 void RootWindowController::UpdateShelfVisibility() {
568 shelf_->shelf_layout_manager()->UpdateVisibilityState(); 568 shelf_->shelf_layout_manager()->UpdateVisibilityState();
569 } 569 }
570 570
571 const aura::Window* RootWindowController::GetWindowForFullscreenMode() const { 571 const aura::Window* RootWindowController::GetWindowForFullscreenMode() const {
572 const aura::Window::Windows& windows = 572 const aura::Window::Windows& windows =
573 GetContainer(kShellWindowId_DefaultContainer)->children(); 573 GetContainer(kShellWindowId_DefaultContainer)->children();
574 const aura::Window* topmost_window = NULL; 574 const aura::Window* topmost_window = NULL;
575 for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin(); 575 const aura::Window* active_window = wm::GetActiveWindow();
oshima 2014/02/21 19:49:46 can you add comment why these two path are necessa
flackr 2014/02/24 16:21:10 Done.
576 iter != windows.rend(); ++iter) { 576 if (active_window && active_window->GetRootWindow() == root_window()) {
577 if (((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL || 577 topmost_window = active_window;
578 (*iter)->type() == ui::wm::WINDOW_TYPE_PANEL) && 578 } else {
579 (*iter)->layer()->GetTargetVisibility()) { 579 for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin();
580 topmost_window = *iter; 580 iter != windows.rend(); ++iter) {
581 break; 581 if (((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL ||
582 (*iter)->type() == ui::wm::WINDOW_TYPE_PANEL) &&
583 (*iter)->layer()->GetTargetVisibility()) {
584 topmost_window = *iter;
585 break;
586 }
582 } 587 }
583 } 588 }
584 while (topmost_window) { 589 while (topmost_window) {
585 if (wm::GetWindowState(topmost_window)->IsFullscreen()) 590 if (wm::GetWindowState(topmost_window)->IsFullscreen())
586 return topmost_window; 591 return topmost_window;
587 topmost_window = views::corewm::GetTransientParent(topmost_window); 592 topmost_window = views::corewm::GetTransientParent(topmost_window);
588 } 593 }
589 return NULL; 594 return NULL;
590 } 595 }
591 596
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 DisableTouchHudProjection(); 984 DisableTouchHudProjection();
980 } 985 }
981 986
982 RootWindowController* GetRootWindowController( 987 RootWindowController* GetRootWindowController(
983 const aura::Window* root_window) { 988 const aura::Window* root_window) {
984 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; 989 return root_window ? GetRootWindowSettings(root_window)->controller : NULL;
985 } 990 }
986 991
987 } // namespace internal 992 } // namespace internal
988 } // namespace ash 993 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698