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

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

Issue 24108003: [Cleanup] Rename WindowSettings to WindowState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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/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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 void PanelLayoutManager::OnWindowResized() { 334 void PanelLayoutManager::OnWindowResized() {
336 Relayout(); 335 Relayout();
337 } 336 }
338 337
339 void PanelLayoutManager::OnWindowAddedToLayout(aura::Window* child) { 338 void PanelLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
340 if (child->type() == aura::client::WINDOW_TYPE_POPUP) 339 if (child->type() == aura::client::WINDOW_TYPE_POPUP)
341 return; 340 return;
342 if (in_add_window_) 341 if (in_add_window_)
343 return; 342 return;
344 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true); 343 base::AutoReset<bool> auto_reset_in_add_window(&in_add_window_, true);
345 if (!wm::GetWindowSettings(child)->panel_attached()) { 344 if (!wm::GetWindowState(child)->panel_attached()) {
346 // This should only happen when a window is added to panel container as a 345 // This should only happen when a window is added to panel container as a
347 // result of bounds change from within the application during a drag. 346 // result of bounds change from within the application during a drag.
348 // If so we have already stopped the drag and should reparent the panel 347 // If so we have already stopped the drag and should reparent the panel
349 // back to appropriate container and ignore it. 348 // back to appropriate container and ignore it.
350 // TODO(varkha): Updating bounds during a drag can cause problems and a more 349 // TODO(varkha): Updating bounds during a drag can cause problems and a more
351 // general solution is needed. See http://crbug.com/251813 . 350 // general solution is needed. See http://crbug.com/251813 .
352 child->SetDefaultParentByRootWindow( 351 child->SetDefaultParentByRootWindow(
353 child->GetRootWindow(), 352 child->GetRootWindow(),
354 child->GetRootWindow()->GetBoundsInScreen()); 353 child->GetRootWindow()->GetBoundsInScreen());
355 DCHECK(child->parent()->id() != kShellWindowId_PanelContainer); 354 DCHECK(child->parent()->id() != kShellWindowId_PanelContainer);
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 863
865 void PanelLayoutManager::OnKeyboardBoundsChanging( 864 void PanelLayoutManager::OnKeyboardBoundsChanging(
866 const gfx::Rect& keyboard_bounds) { 865 const gfx::Rect& keyboard_bounds) {
867 // This bounds change will have caused a change to the Shelf which does not 866 // This bounds change will have caused a change to the Shelf which does not
868 // propogate automatically to this class, so manually recalculate bounds. 867 // propogate automatically to this class, so manually recalculate bounds.
869 OnWindowResized(); 868 OnWindowResized();
870 } 869 }
871 870
872 } // namespace internal 871 } // namespace internal
873 } // namespace ash 872 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698