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

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

Issue 2731663002: Remove WmWindowProperty (Closed)
Patch Set: 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
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/common/wm/panels/panel_layout_manager.h" 5 #include "ash/common/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/common/shelf/wm_shelf.h" 11 #include "ash/common/shelf/wm_shelf.h"
12 #include "ash/common/shelf/wm_shelf_util.h" 12 #include "ash/common/shelf/wm_shelf_util.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_state.h" 16 #include "ash/common/wm/window_state.h"
17 #include "ash/common/wm_lookup.h" 17 #include "ash/common/wm_lookup.h"
18 #include "ash/common/wm_shell.h" 18 #include "ash/common/wm_shell.h"
19 #include "ash/common/wm_window.h" 19 #include "ash/common/wm_window.h"
20 #include "ash/common/wm_window_property.h"
21 #include "ash/public/cpp/shell_window_ids.h" 20 #include "ash/public/cpp/shell_window_ids.h"
21 #include "ash/public/cpp/window_properties.h"
22 #include "ash/root_window_controller.h" 22 #include "ash/root_window_controller.h"
23 #include "ash/wm/window_properties.h" 23 #include "ash/wm/window_properties.h"
24 #include "base/auto_reset.h" 24 #include "base/auto_reset.h"
25 #include "third_party/skia/include/core/SkColor.h" 25 #include "third_party/skia/include/core/SkColor.h"
26 #include "third_party/skia/include/core/SkPath.h" 26 #include "third_party/skia/include/core/SkPath.h"
27 #include "ui/compositor/scoped_layer_animation_settings.h" 27 #include "ui/compositor/scoped_layer_animation_settings.h"
28 #include "ui/gfx/canvas.h" 28 #include "ui/gfx/canvas.h"
29 #include "ui/gfx/geometry/rect.h" 29 #include "ui/gfx/geometry/rect.h"
30 #include "ui/gfx/geometry/vector2d.h" 30 #include "ui/gfx/geometry/vector2d.h"
31 #include "ui/views/background.h" 31 #include "ui/views/background.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 void PanelLayoutManager::OnWindowResized() { 333 void PanelLayoutManager::OnWindowResized() {
334 Relayout(); 334 Relayout();
335 } 335 }
336 336
337 void PanelLayoutManager::OnWindowAddedToLayout(WmWindow* child) { 337 void PanelLayoutManager::OnWindowAddedToLayout(WmWindow* child) {
338 if (child->GetType() == ui::wm::WINDOW_TYPE_POPUP) 338 if (child->GetType() == ui::wm::WINDOW_TYPE_POPUP)
339 return; 339 return;
340 if (in_add_window_) 340 if (in_add_window_)
341 return; 341 return;
342 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true); 342 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true);
343 if (!child->GetBoolProperty(WmWindowProperty::PANEL_ATTACHED)) { 343 if (!child->aura_window()->GetProperty(kPanelAttachedKey)) {
344 // This should only happen when a window is added to panel container as a 344 // This should only happen when a window is added to panel container as a
345 // result of bounds change from within the application during a drag. 345 // result of bounds change from within the application during a drag.
346 // If so we have already stopped the drag and should reparent the panel 346 // If so we have already stopped the drag and should reparent the panel
347 // back to appropriate container and ignore it. 347 // back to appropriate container and ignore it.
348 // TODO(varkha): Updating bounds during a drag can cause problems and a more 348 // TODO(varkha): Updating bounds during a drag can cause problems and a more
349 // general solution is needed. See http://crbug.com/251813 . 349 // general solution is needed. See http://crbug.com/251813 .
350 WmWindow* old_parent = child->GetParent(); 350 WmWindow* old_parent = child->GetParent();
351 child->SetParentUsingContext(child, 351 child->SetParentUsingContext(child,
352 child->GetRootWindow()->GetBoundsInScreen()); 352 child->GetRootWindow()->GetBoundsInScreen());
353 wm::ReparentTransientChildrenOfChild(child, old_parent, child->GetParent()); 353 wm::ReparentTransientChildrenOfChild(child, old_parent, child->GetParent());
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 } 921 }
922 } 922 }
923 // This bounds change will have caused a change to the Shelf which does not 923 // This bounds change will have caused a change to the Shelf which does not
924 // propogate automatically to this class, so manually recalculate bounds. 924 // propogate automatically to this class, so manually recalculate bounds.
925 OnWindowResized(); 925 OnWindowResized();
926 } 926 }
927 927
928 void PanelLayoutManager::OnKeyboardClosed() {} 928 void PanelLayoutManager::OnKeyboardClosed() {}
929 929
930 } // namespace ash 930 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698