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

Side by Side Diff: ash/wm/panels/panel_layout_manager.cc

Issue 1890713002: Adds WmWindow and converts WindowState to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge again Created 4 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 (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/wm/panels/panel_layout_manager.h" 5 #include "ash/wm/panels/panel_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 10
11 #include "ash/screen_util.h" 11 #include "ash/screen_util.h"
12 #include "ash/shelf/shelf.h" 12 #include "ash/shelf/shelf.h"
13 #include "ash/shelf/shelf_layout_manager.h" 13 #include "ash/shelf/shelf_layout_manager.h"
14 #include "ash/shelf/shelf_types.h" 14 #include "ash/shelf/shelf_types.h"
15 #include "ash/shelf/shelf_util.h" 15 #include "ash/shelf/shelf_util.h"
16 #include "ash/shelf/shelf_widget.h" 16 #include "ash/shelf/shelf_widget.h"
17 #include "ash/shell.h" 17 #include "ash/shell.h"
18 #include "ash/shell_window_ids.h" 18 #include "ash/shell_window_ids.h"
19 #include "ash/wm/overview/window_selector_controller.h" 19 #include "ash/wm/overview/window_selector_controller.h"
20 #include "ash/wm/window_animations.h" 20 #include "ash/wm/window_animations.h"
21 #include "ash/wm/window_state.h" 21 #include "ash/wm/window_state.h"
22 #include "ash/wm/window_state_aura.h"
22 #include "ash/wm/window_util.h" 23 #include "ash/wm/window_util.h"
23 #include "base/auto_reset.h" 24 #include "base/auto_reset.h"
24 #include "base/bind.h" 25 #include "base/bind.h"
25 #include "base/bind_helpers.h" 26 #include "base/bind_helpers.h"
26 #include "third_party/skia/include/core/SkColor.h" 27 #include "third_party/skia/include/core/SkColor.h"
27 #include "third_party/skia/include/core/SkPaint.h" 28 #include "third_party/skia/include/core/SkPaint.h"
28 #include "third_party/skia/include/core/SkPath.h" 29 #include "third_party/skia/include/core/SkPath.h"
29 #include "ui/aura/client/focus_client.h" 30 #include "ui/aura/client/focus_client.h"
30 #include "ui/aura/client/window_tree_client.h" 31 #include "ui/aura/client/window_tree_client.h"
31 #include "ui/aura/window.h" 32 #include "ui/aura/window.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 ///////////////////////////////////////////////////////////////////////////// 481 /////////////////////////////////////////////////////////////////////////////
481 // PanelLayoutManager, WindowStateObserver implementation: 482 // PanelLayoutManager, WindowStateObserver implementation:
482 483
483 void PanelLayoutManager::OnPostWindowStateTypeChange( 484 void PanelLayoutManager::OnPostWindowStateTypeChange(
484 wm::WindowState* window_state, 485 wm::WindowState* window_state,
485 wm::WindowStateType old_type) { 486 wm::WindowStateType old_type) {
486 // If the shelf is currently hidden then windows will not actually be shown 487 // If the shelf is currently hidden then windows will not actually be shown
487 // but the set to restore when the shelf becomes visible is updated. 488 // but the set to restore when the shelf becomes visible is updated.
488 if (restore_windows_on_shelf_visible_) { 489 if (restore_windows_on_shelf_visible_) {
489 if (window_state->IsMinimized()) { 490 if (window_state->IsMinimized()) {
490 MinimizePanel(window_state->window()); 491 MinimizePanel(window_state->aura_window());
491 restore_windows_on_shelf_visible_->Remove(window_state->window()); 492 restore_windows_on_shelf_visible_->Remove(window_state->aura_window());
492 } else { 493 } else {
493 restore_windows_on_shelf_visible_->Add(window_state->window()); 494 restore_windows_on_shelf_visible_->Add(window_state->aura_window());
494 } 495 }
495 return; 496 return;
496 } 497 }
497 498
498 if (window_state->IsMinimized()) 499 if (window_state->IsMinimized())
499 MinimizePanel(window_state->window()); 500 MinimizePanel(window_state->aura_window());
500 else 501 else
501 RestorePanel(window_state->window()); 502 RestorePanel(window_state->aura_window());
502 } 503 }
503 504
504 //////////////////////////////////////////////////////////////////////////////// 505 ////////////////////////////////////////////////////////////////////////////////
505 // PanelLayoutManager, aura::client::ActivationChangeObserver implementation: 506 // PanelLayoutManager, aura::client::ActivationChangeObserver implementation:
506 507
507 void PanelLayoutManager::OnWindowActivated( 508 void PanelLayoutManager::OnWindowActivated(
508 aura::client::ActivationChangeObserver::ActivationReason reason, 509 aura::client::ActivationChangeObserver::ActivationReason reason,
509 aura::Window* gained_active, 510 aura::Window* gained_active,
510 aura::Window* lost_active) { 511 aura::Window* lost_active) {
511 // Ignore if the panel that is not managed by this was activated. 512 // Ignore if the panel that is not managed by this was activated.
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 // Keyboard hidden, restore original bounds if they exist. 930 // Keyboard hidden, restore original bounds if they exist.
930 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen()); 931 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen());
931 } 932 }
932 } 933 }
933 // This bounds change will have caused a change to the Shelf which does not 934 // This bounds change will have caused a change to the Shelf which does not
934 // propogate automatically to this class, so manually recalculate bounds. 935 // propogate automatically to this class, so manually recalculate bounds.
935 OnWindowResized(); 936 OnWindowResized();
936 } 937 }
937 938
938 } // namespace ash 939 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/overview/window_selector_unittest.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698