| OLD | NEW |
| 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/screen_ash.h" | 8 #include "ash/screen_ash.h" |
| 9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
| 10 #include "ash/shelf/shelf_constants.h" | 10 #include "ash/shelf/shelf_constants.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "ui/aura/client/window_tree_client.h" | 30 #include "ui/aura/client/window_tree_client.h" |
| 31 #include "ui/aura/root_window.h" | 31 #include "ui/aura/root_window.h" |
| 32 #include "ui/aura/window.h" | 32 #include "ui/aura/window.h" |
| 33 #include "ui/aura/window_delegate.h" | 33 #include "ui/aura/window_delegate.h" |
| 34 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
| 35 #include "ui/compositor/scoped_layer_animation_settings.h" | 35 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 36 #include "ui/gfx/canvas.h" | 36 #include "ui/gfx/canvas.h" |
| 37 #include "ui/gfx/image/image_skia_operations.h" | 37 #include "ui/gfx/image/image_skia_operations.h" |
| 38 #include "ui/gfx/rect.h" | 38 #include "ui/gfx/rect.h" |
| 39 #include "ui/views/background.h" | 39 #include "ui/views/background.h" |
| 40 #include "ui/views/corewm/window_util.h" |
| 40 | 41 |
| 41 namespace ash { | 42 namespace ash { |
| 42 namespace internal { | 43 namespace internal { |
| 43 | 44 |
| 44 // Minimum, maximum width of the dock area and a width of the gap | 45 // Minimum, maximum width of the dock area and a width of the gap |
| 45 // static | 46 // static |
| 46 const int DockedWindowLayoutManager::kMaxDockWidth = 360; | 47 const int DockedWindowLayoutManager::kMaxDockWidth = 360; |
| 47 // static | 48 // static |
| 48 const int DockedWindowLayoutManager::kMinDockWidth = 200; | 49 const int DockedWindowLayoutManager::kMinDockWidth = 200; |
| 49 // static | 50 // static |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 gfx::ImageSkia shelf_background_right_; | 183 gfx::ImageSkia shelf_background_right_; |
| 183 | 184 |
| 184 DISALLOW_COPY_AND_ASSIGN(DockedBackgroundWidget); | 185 DISALLOW_COPY_AND_ASSIGN(DockedBackgroundWidget); |
| 185 }; | 186 }; |
| 186 | 187 |
| 187 namespace { | 188 namespace { |
| 188 | 189 |
| 189 // Returns true if a window is a popup or a transient child. | 190 // Returns true if a window is a popup or a transient child. |
| 190 bool IsPopupOrTransient(const aura::Window* window) { | 191 bool IsPopupOrTransient(const aura::Window* window) { |
| 191 return (window->type() == ui::wm::WINDOW_TYPE_POPUP || | 192 return (window->type() == ui::wm::WINDOW_TYPE_POPUP || |
| 192 window->transient_parent()); | 193 views::corewm::GetTransientParent(window)); |
| 193 } | 194 } |
| 194 | 195 |
| 195 // Certain windows (minimized, hidden or popups) do not matter to docking. | 196 // Certain windows (minimized, hidden or popups) do not matter to docking. |
| 196 bool IsUsedByLayout(const aura::Window* window) { | 197 bool IsUsedByLayout(const aura::Window* window) { |
| 197 return (window->IsVisible() && | 198 return (window->IsVisible() && |
| 198 !wm::GetWindowState(window)->IsMinimized() && | 199 !wm::GetWindowState(window)->IsMinimized() && |
| 199 !IsPopupOrTransient(window)); | 200 !IsPopupOrTransient(window)); |
| 200 } | 201 } |
| 201 | 202 |
| 202 void UndockWindow(aura::Window* window) { | 203 void UndockWindow(aura::Window* window) { |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1243 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
| 1243 const gfx::Rect& keyboard_bounds) { | 1244 const gfx::Rect& keyboard_bounds) { |
| 1244 // This bounds change will have caused a change to the Shelf which does not | 1245 // This bounds change will have caused a change to the Shelf which does not |
| 1245 // propagate automatically to this class, so manually recalculate bounds. | 1246 // propagate automatically to this class, so manually recalculate bounds. |
| 1246 Relayout(); | 1247 Relayout(); |
| 1247 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1248 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
| 1248 } | 1249 } |
| 1249 | 1250 |
| 1250 } // namespace internal | 1251 } // namespace internal |
| 1251 } // namespace ash | 1252 } // namespace ash |
| OLD | NEW |