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

Side by Side Diff: ash/common/wm/dock/docked_window_layout_manager.cc

Issue 2726823003: Remove WmLookup. (Closed)
Patch Set: Clean up include and modify comment. Created 3 years, 9 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
« no previous file with comments | « ash/common/wm/container_finder_unittest.cc ('k') | ash/common/wm/dock/docked_window_resizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/dock/docked_window_layout_manager.h" 5 #include "ash/common/wm/dock/docked_window_layout_manager.h"
6 6
7 #include "ash/animation/animation_change_type.h" 7 #include "ash/animation/animation_change_type.h"
8 #include "ash/common/shelf/shelf_background_animator.h" 8 #include "ash/common/shelf/shelf_background_animator.h"
9 #include "ash/common/shelf/shelf_background_animator_observer.h" 9 #include "ash/common/shelf/shelf_background_animator_observer.h"
10 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
11 #include "ash/common/shelf/wm_shelf.h" 11 #include "ash/common/shelf/wm_shelf.h"
12 #include "ash/common/shelf/wm_shelf_observer.h" 12 #include "ash/common/shelf/wm_shelf_observer.h"
13 #include "ash/common/wm/overview/window_selector_controller.h" 13 #include "ash/common/wm/overview/window_selector_controller.h"
14 #include "ash/common/wm/window_animation_types.h" 14 #include "ash/common/wm/window_animation_types.h"
15 #include "ash/common/wm/window_parenting_utils.h" 15 #include "ash/common/wm/window_parenting_utils.h"
16 #include "ash/common/wm/window_resizer.h" 16 #include "ash/common/wm/window_resizer.h"
17 #include "ash/common/wm/window_state.h" 17 #include "ash/common/wm/window_state.h"
18 #include "ash/common/wm_lookup.h"
19 #include "ash/common/wm_shell.h" 18 #include "ash/common/wm_shell.h"
20 #include "ash/common/wm_window.h" 19 #include "ash/common/wm_window.h"
21 #include "ash/public/cpp/shell_window_ids.h" 20 #include "ash/public/cpp/shell_window_ids.h"
22 #include "ash/resources/grit/ash_resources.h" 21 #include "ash/resources/grit/ash_resources.h"
23 #include "ash/root_window_controller.h" 22 #include "ash/root_window_controller.h"
24 #include "ash/wm/window_state_aura.h" 23 #include "ash/wm/window_state_aura.h"
25 #include "base/auto_reset.h" 24 #include "base/auto_reset.h"
26 #include "base/metrics/histogram_macros.h" 25 #include "base/metrics/histogram_macros.h"
27 #include "third_party/skia/include/core/SkColor.h" 26 #include "third_party/skia/include/core/SkColor.h"
28 #include "ui/base/resource/resource_bundle.h" 27 #include "ui/base/resource/resource_bundle.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 params.type = views::Widget::InitParams::TYPE_POPUP; 108 params.type = views::Widget::InitParams::TYPE_POPUP;
110 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 109 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
111 params.keep_on_top = false; 110 params.keep_on_top = false;
112 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 111 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
113 params.accept_events = false; 112 params.accept_events = false;
114 set_focus_on_creation(false); 113 set_focus_on_creation(false);
115 parent->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( 114 parent->GetRootWindowController()->ConfigureWidgetInitParamsForContainer(
116 this, parent->GetShellWindowId(), &params); 115 this, parent->GetShellWindowId(), &params);
117 Init(params); 116 Init(params);
118 SetVisibilityChangedAnimationsEnabled(false); 117 SetVisibilityChangedAnimationsEnabled(false);
119 WmWindow* wm_window = WmLookup::Get()->GetWindowForWidget(this); 118 WmWindow* wm_window = WmWindow::Get(this->GetNativeWindow());
120 wm_window->SetLockedToRoot(true); 119 wm_window->SetLockedToRoot(true);
121 opaque_background_.SetColor(SK_ColorBLACK); 120 opaque_background_.SetColor(SK_ColorBLACK);
122 opaque_background_.SetBounds(gfx::Rect(GetWindowBoundsInScreen().size())); 121 opaque_background_.SetBounds(gfx::Rect(GetWindowBoundsInScreen().size()));
123 opaque_background_.SetOpacity(0.0f); 122 opaque_background_.SetOpacity(0.0f);
124 wm_window->GetLayer()->Add(&opaque_background_); 123 wm_window->GetLayer()->Add(&opaque_background_);
125 124
126 // This background should be explicitly stacked below any windows already in 125 // This background should be explicitly stacked below any windows already in
127 // the dock, otherwise the z-order is set by the order in which windows were 126 // the dock, otherwise the z-order is set by the order in which windows were
128 // added to the container, and UpdateStacking only manages user windows, not 127 // added to the container, and UpdateStacking only manages user windows, not
129 // the background widget. 128 // the background widget.
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 const gfx::Rect& keyboard_bounds) { 1327 const gfx::Rect& keyboard_bounds) {
1329 // This bounds change will have caused a change to the Shelf which does not 1328 // This bounds change will have caused a change to the Shelf which does not
1330 // propagate automatically to this class, so manually recalculate bounds. 1329 // propagate automatically to this class, so manually recalculate bounds.
1331 Relayout(); 1330 Relayout();
1332 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); 1331 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING);
1333 } 1332 }
1334 1333
1335 void DockedWindowLayoutManager::OnKeyboardClosed() {} 1334 void DockedWindowLayoutManager::OnKeyboardClosed() {}
1336 1335
1337 } // namespace ash 1336 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/container_finder_unittest.cc ('k') | ash/common/wm/dock/docked_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698