| OLD | NEW |
| 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 | 9 |
| 10 #include "ash/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
| 11 #include "ash/screen_ash.h" | 11 #include "ash/screen_ash.h" |
| 12 #include "ash/shelf/shelf_layout_manager.h" | 12 #include "ash/shelf/shelf_layout_manager.h" |
| 13 #include "ash/shelf/shelf_types.h" | 13 #include "ash/shelf/shelf_types.h" |
| 14 #include "ash/shelf/shelf_widget.h" | 14 #include "ash/shelf/shelf_widget.h" |
| 15 #include "ash/shell.h" | 15 #include "ash/shell.h" |
| 16 #include "ash/shell_window_ids.h" | 16 #include "ash/shell_window_ids.h" |
| 17 #include "ash/wm/frame_painter.h" | 17 #include "ash/wm/frame_painter.h" |
| 18 #include "ash/wm/property_util.h" | |
| 19 #include "ash/wm/window_animations.h" | 18 #include "ash/wm/window_animations.h" |
| 20 #include "ash/wm/window_settings.h" | 19 #include "ash/wm/window_state.h" |
| 21 #include "ash/wm/window_util.h" | 20 #include "ash/wm/window_util.h" |
| 22 #include "base/auto_reset.h" | 21 #include "base/auto_reset.h" |
| 23 #include "base/bind.h" | 22 #include "base/bind.h" |
| 24 #include "base/bind_helpers.h" | 23 #include "base/bind_helpers.h" |
| 25 #include "third_party/skia/include/core/SkColor.h" | 24 #include "third_party/skia/include/core/SkColor.h" |
| 26 #include "third_party/skia/include/core/SkPaint.h" | 25 #include "third_party/skia/include/core/SkPaint.h" |
| 27 #include "third_party/skia/include/core/SkPath.h" | 26 #include "third_party/skia/include/core/SkPath.h" |
| 28 #include "ui/aura/client/activation_client.h" | 27 #include "ui/aura/client/activation_client.h" |
| 29 #include "ui/aura/client/aura_constants.h" | 28 #include "ui/aura/client/aura_constants.h" |
| 30 #include "ui/aura/focus_manager.h" | 29 #include "ui/aura/focus_manager.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 void PanelLayoutManager::OnWindowResized() { | 343 void PanelLayoutManager::OnWindowResized() { |
| 345 Relayout(); | 344 Relayout(); |
| 346 } | 345 } |
| 347 | 346 |
| 348 void PanelLayoutManager::OnWindowAddedToLayout(aura::Window* child) { | 347 void PanelLayoutManager::OnWindowAddedToLayout(aura::Window* child) { |
| 349 if (child->type() == aura::client::WINDOW_TYPE_POPUP) | 348 if (child->type() == aura::client::WINDOW_TYPE_POPUP) |
| 350 return; | 349 return; |
| 351 if (in_add_window_) | 350 if (in_add_window_) |
| 352 return; | 351 return; |
| 353 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true); | 352 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true); |
| 354 if (!wm::GetWindowSettings(child)->panel_attached()) { | 353 if (!wm::GetWindowState(child)->panel_attached()) { |
| 355 // This should only happen when a window is added to panel container as a | 354 // This should only happen when a window is added to panel container as a |
| 356 // result of bounds change from within the application during a drag. | 355 // result of bounds change from within the application during a drag. |
| 357 // If so we have already stopped the drag and should reparent the panel | 356 // If so we have already stopped the drag and should reparent the panel |
| 358 // back to appropriate container and ignore it. | 357 // back to appropriate container and ignore it. |
| 359 // TODO(varkha): Updating bounds during a drag can cause problems and a more | 358 // TODO(varkha): Updating bounds during a drag can cause problems and a more |
| 360 // general solution is needed. See http://crbug.com/251813 . | 359 // general solution is needed. See http://crbug.com/251813 . |
| 361 child->SetDefaultParentByRootWindow( | 360 child->SetDefaultParentByRootWindow( |
| 362 child->GetRootWindow(), | 361 child->GetRootWindow(), |
| 363 child->GetRootWindow()->GetBoundsInScreen()); | 362 child->GetRootWindow()->GetBoundsInScreen()); |
| 364 DCHECK(child->parent()->id() != kShellWindowId_PanelContainer); | 363 DCHECK(child->parent()->id() != kShellWindowId_PanelContainer); |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 | 873 |
| 875 void PanelLayoutManager::OnKeyboardBoundsChanging( | 874 void PanelLayoutManager::OnKeyboardBoundsChanging( |
| 876 const gfx::Rect& keyboard_bounds) { | 875 const gfx::Rect& keyboard_bounds) { |
| 877 // This bounds change will have caused a change to the Shelf which does not | 876 // This bounds change will have caused a change to the Shelf which does not |
| 878 // propogate automatically to this class, so manually recalculate bounds. | 877 // propogate automatically to this class, so manually recalculate bounds. |
| 879 OnWindowResized(); | 878 OnWindowResized(); |
| 880 } | 879 } |
| 881 | 880 |
| 882 } // namespace internal | 881 } // namespace internal |
| 883 } // namespace ash | 882 } // namespace ash |
| OLD | NEW |