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/workspace/workspace_layout_manager2.h" | 5 #include "ash/wm/workspace/workspace_layout_manager2.h" |
6 | 6 |
| 7 #include "ash/root_window_controller.h" |
7 #include "ash/shell.h" | 8 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
9 #include "ash/wm/property_util.h" | 10 #include "ash/wm/property_util.h" |
10 #include "ash/wm/shelf_layout_manager.h" | 11 #include "ash/wm/shelf_layout_manager.h" |
11 #include "ash/wm/window_util.h" | 12 #include "ash/wm/window_util.h" |
12 #include "ui/aura/root_window.h" | 13 #include "ui/aura/root_window.h" |
13 #include "ui/aura/test/test_windows.h" | 14 #include "ui/aura/test/test_windows.h" |
14 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
15 #include "ui/gfx/insets.h" | 16 #include "ui/gfx/insets.h" |
16 | 17 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual void OnWindowPropertyChanged(aura::Window* window, | 59 virtual void OnWindowPropertyChanged(aura::Window* window, |
59 const void* key, | 60 const void* key, |
60 intptr_t old) { | 61 intptr_t old) { |
61 if (!window_) | 62 if (!window_) |
62 return; | 63 return; |
63 | 64 |
64 if (wm::IsWindowMaximized(window)) { | 65 if (wm::IsWindowMaximized(window)) { |
65 aura::Window* w = window_; | 66 aura::Window* w = window_; |
66 window_ = NULL; | 67 window_ = NULL; |
67 | 68 |
68 gfx::Rect shelf_bounds(Shell::GetInstance()->shelf()->GetIdealBounds()); | 69 gfx::Rect shelf_bounds( |
| 70 Shell::GetPrimaryRootWindowController()->shelf()->GetIdealBounds()); |
69 const gfx::Rect& window_bounds(w->bounds()); | 71 const gfx::Rect& window_bounds(w->bounds()); |
70 w->SetBounds(gfx::Rect(window_bounds.x(), shelf_bounds.y() - 1, | 72 w->SetBounds(gfx::Rect(window_bounds.x(), shelf_bounds.y() - 1, |
71 window_bounds.width(), window_bounds.height())); | 73 window_bounds.width(), window_bounds.height())); |
72 } | 74 } |
73 } | 75 } |
74 | 76 |
75 private: | 77 private: |
76 aura::Window* window_; | 78 aura::Window* window_; |
77 | 79 |
78 DISALLOW_COPY_AND_ASSIGN(DontClobberRestoreBoundsWindowObserver); | 80 DISALLOW_COPY_AND_ASSIGN(DontClobberRestoreBoundsWindowObserver); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 window_bounds.Offset(root_window_bounds.width(), root_window_bounds.height()); | 132 window_bounds.Offset(root_window_bounds.width(), root_window_bounds.height()); |
131 ASSERT_FALSE(window_bounds.Intersects(root_window_bounds)); | 133 ASSERT_FALSE(window_bounds.Intersects(root_window_bounds)); |
132 scoped_ptr<aura::Window> out_window(CreateTestWindow(window_bounds)); | 134 scoped_ptr<aura::Window> out_window(CreateTestWindow(window_bounds)); |
133 EXPECT_EQ(window_bounds.size(), out_window->bounds().size()); | 135 EXPECT_EQ(window_bounds.size(), out_window->bounds().size()); |
134 EXPECT_TRUE(out_window->bounds().Intersects(root_window_bounds)); | 136 EXPECT_TRUE(out_window->bounds().Intersects(root_window_bounds)); |
135 } | 137 } |
136 | 138 |
137 } // namespace | 139 } // namespace |
138 | 140 |
139 } // namespace ash | 141 } // namespace ash |
OLD | NEW |