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

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

Issue 115453004: Moves management of transients out of Window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix MRUWindowTracker and MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest Created 7 years 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) 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/wm/dock/docked_window_layout_manager.h" 5 #include "ash/wm/dock/docked_window_layout_manager.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/launcher/launcher.h" 8 #include "ash/launcher/launcher.h"
9 #include "ash/screen_ash.h" 9 #include "ash/screen_ash.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 18 matching lines...) Expand all
29 #include "ui/aura/client/window_tree_client.h" 29 #include "ui/aura/client/window_tree_client.h"
30 #include "ui/aura/root_window.h" 30 #include "ui/aura/root_window.h"
31 #include "ui/aura/window.h" 31 #include "ui/aura/window.h"
32 #include "ui/aura/window_delegate.h" 32 #include "ui/aura/window_delegate.h"
33 #include "ui/base/resource/resource_bundle.h" 33 #include "ui/base/resource/resource_bundle.h"
34 #include "ui/compositor/scoped_layer_animation_settings.h" 34 #include "ui/compositor/scoped_layer_animation_settings.h"
35 #include "ui/gfx/canvas.h" 35 #include "ui/gfx/canvas.h"
36 #include "ui/gfx/image/image_skia_operations.h" 36 #include "ui/gfx/image/image_skia_operations.h"
37 #include "ui/gfx/rect.h" 37 #include "ui/gfx/rect.h"
38 #include "ui/views/background.h" 38 #include "ui/views/background.h"
39 #include "ui/views/corewm/transient_window_manager.h"
39 40
40 namespace ash { 41 namespace ash {
41 namespace internal { 42 namespace internal {
42 43
43 // Minimum, maximum width of the dock area and a width of the gap 44 // Minimum, maximum width of the dock area and a width of the gap
44 // static 45 // static
45 const int DockedWindowLayoutManager::kMaxDockWidth = 360; 46 const int DockedWindowLayoutManager::kMaxDockWidth = 360;
46 // static 47 // static
47 const int DockedWindowLayoutManager::kMinDockWidth = 200; 48 const int DockedWindowLayoutManager::kMinDockWidth = 200;
48 // static 49 // static
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 gfx::ImageSkia launcher_background_right_; 175 gfx::ImageSkia launcher_background_right_;
175 176
176 DISALLOW_COPY_AND_ASSIGN(DockedBackgroundWidget); 177 DISALLOW_COPY_AND_ASSIGN(DockedBackgroundWidget);
177 }; 178 };
178 179
179 namespace { 180 namespace {
180 181
181 // Returns true if a window is a popup or a transient child. 182 // Returns true if a window is a popup or a transient child.
182 bool IsPopupOrTransient(const aura::Window* window) { 183 bool IsPopupOrTransient(const aura::Window* window) {
183 return (window->type() == aura::client::WINDOW_TYPE_POPUP || 184 return (window->type() == aura::client::WINDOW_TYPE_POPUP ||
184 window->transient_parent()); 185 views::corewm::GetTransientParent(window));
185 } 186 }
186 187
187 // Certain windows (minimized, hidden or popups) do not matter to docking. 188 // Certain windows (minimized, hidden or popups) do not matter to docking.
188 bool IsUsedByLayout(const aura::Window* window) { 189 bool IsUsedByLayout(const aura::Window* window) {
189 return (window->IsVisible() && 190 return (window->IsVisible() &&
190 !wm::GetWindowState(window)->IsMinimized() && 191 !wm::GetWindowState(window)->IsMinimized() &&
191 !IsPopupOrTransient(window)); 192 !IsPopupOrTransient(window));
192 } 193 }
193 194
194 void UndockWindow(aura::Window* window) { 195 void UndockWindow(aura::Window* window) {
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( 1232 void DockedWindowLayoutManager::OnKeyboardBoundsChanging(
1232 const gfx::Rect& keyboard_bounds) { 1233 const gfx::Rect& keyboard_bounds) {
1233 // This bounds change will have caused a change to the Shelf which does not 1234 // This bounds change will have caused a change to the Shelf which does not
1234 // propagate automatically to this class, so manually recalculate bounds. 1235 // propagate automatically to this class, so manually recalculate bounds.
1235 Relayout(); 1236 Relayout();
1236 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); 1237 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING);
1237 } 1238 }
1238 1239
1239 } // namespace internal 1240 } // namespace internal
1240 } // namespace ash 1241 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698