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_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include "ash/display/display_layout.h" | 7 #include "ash/display/display_layout.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/screen_ash.h" | 10 #include "ash/screen_ash.h" |
11 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.h" |
12 #include "ash/shelf/shelf_widget.h" | 12 #include "ash/shelf/shelf_widget.h" |
13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
14 #include "ash/shell_observer.h" | 14 #include "ash/shell_observer.h" |
15 #include "ash/test/ash_test_base.h" | 15 #include "ash/test/ash_test_base.h" |
16 #include "ash/wm/window_state.h" | 16 #include "ash/wm/window_state.h" |
17 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
18 #include "ui/aura/client/aura_constants.h" | 18 #include "ui/aura/client/aura_constants.h" |
19 #include "ui/aura/root_window.h" | 19 #include "ui/aura/root_window.h" |
20 #include "ui/aura/test/test_windows.h" | 20 #include "ui/aura/test/test_windows.h" |
21 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
22 #include "ui/gfx/insets.h" | 22 #include "ui/gfx/insets.h" |
| 23 #include "ui/views/corewm/window_util.h" |
23 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
24 #include "ui/views/widget/widget_delegate.h" | 25 #include "ui/views/widget/widget_delegate.h" |
25 | 26 |
26 namespace ash { | 27 namespace ash { |
27 namespace { | 28 namespace { |
28 | 29 |
29 class MaximizeDelegateView : public views::WidgetDelegateView { | 30 class MaximizeDelegateView : public views::WidgetDelegateView { |
30 public: | 31 public: |
31 MaximizeDelegateView(const gfx::Rect& initial_bounds) | 32 MaximizeDelegateView(const gfx::Rect& initial_bounds) |
32 : initial_bounds_(initial_bounds) { | 33 : initial_bounds_(initial_bounds) { |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // before the parent set. This mimics what BrowserFrameAsh does. | 323 // before the parent set. This mimics what BrowserFrameAsh does. |
323 window->AddObserver(&window_observer); | 324 window->AddObserver(&window_observer); |
324 ParentWindowInPrimaryRootWindow(window.get()); | 325 ParentWindowInPrimaryRootWindow(window.get()); |
325 window->Show(); | 326 window->Show(); |
326 | 327 |
327 wm::WindowState* window_state = wm::GetWindowState(window.get()); | 328 wm::WindowState* window_state = wm::GetWindowState(window.get()); |
328 window_state->Activate(); | 329 window_state->Activate(); |
329 | 330 |
330 scoped_ptr<aura::Window> window2( | 331 scoped_ptr<aura::Window> window2( |
331 CreateTestWindowInShellWithBounds(gfx::Rect(12, 20, 30, 40))); | 332 CreateTestWindowInShellWithBounds(gfx::Rect(12, 20, 30, 40))); |
332 window->AddTransientChild(window2.get()); | 333 views::corewm::AddTransientChild(window.get(), window2.get()); |
333 window2->Show(); | 334 window2->Show(); |
334 | 335 |
335 window_observer.set_window(window2.get()); | 336 window_observer.set_window(window2.get()); |
336 window_state->Maximize(); | 337 window_state->Maximize(); |
337 EXPECT_EQ("10,20 30x40", | 338 EXPECT_EQ("10,20 30x40", |
338 window_state->GetRestoreBoundsInScreen().ToString()); | 339 window_state->GetRestoreBoundsInScreen().ToString()); |
339 window->RemoveObserver(&window_observer); | 340 window->RemoveObserver(&window_observer); |
340 } | 341 } |
341 | 342 |
342 // Verifies when a window is maximized all descendant windows have a size. | 343 // Verifies when a window is maximized all descendant windows have a size. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 EXPECT_EQ(5, observer.call_count()); | 473 EXPECT_EQ(5, observer.call_count()); |
473 EXPECT_TRUE(observer.is_fullscreen()); | 474 EXPECT_TRUE(observer.is_fullscreen()); |
474 | 475 |
475 // Closing the window should change the fullscreen state. | 476 // Closing the window should change the fullscreen state. |
476 window2.reset(); | 477 window2.reset(); |
477 EXPECT_EQ(6, observer.call_count()); | 478 EXPECT_EQ(6, observer.call_count()); |
478 EXPECT_FALSE(observer.is_fullscreen()); | 479 EXPECT_FALSE(observer.is_fullscreen()); |
479 } | 480 } |
480 | 481 |
481 } // namespace ash | 482 } // namespace ash |
OLD | NEW |