OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/frame/custom_frame_view_ash.h" | 5 #include "ash/frame/custom_frame_view_ash.h" |
6 | 6 |
7 #include "ash/frame/caption_buttons/frame_caption_button.h" | 7 #include "ash/frame/caption_buttons/frame_caption_button.h" |
8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
11 #include "ash/test/test_session_state_delegate.h" | 11 #include "ash/test/test_session_state_delegate.h" |
| 12 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "grit/ash_resources.h" | 14 #include "grit/ash_resources.h" |
14 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/gfx/image/image_skia.h" | 16 #include "ui/gfx/image/image_skia.h" |
16 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
17 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
18 #include "ui/views/widget/widget_delegate.h" | 19 #include "ui/views/widget/widget_delegate.h" |
19 | 20 |
20 namespace ash { | 21 namespace ash { |
21 | 22 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 203 |
203 // The visibility of the size button is updated when maximize mode is toggled. | 204 // The visibility of the size button is updated when maximize mode is toggled. |
204 // Verify that the layout of the HeaderView is updated for the size button's | 205 // Verify that the layout of the HeaderView is updated for the size button's |
205 // new visibility. | 206 // new visibility. |
206 TEST_F(CustomFrameViewAshTest, HeaderViewNotifiedOfChildSizeChange) { | 207 TEST_F(CustomFrameViewAshTest, HeaderViewNotifiedOfChildSizeChange) { |
207 TestWidgetConstraintsDelegate* delegate = new TestWidgetConstraintsDelegate; | 208 TestWidgetConstraintsDelegate* delegate = new TestWidgetConstraintsDelegate; |
208 scoped_ptr<views::Widget> widget(CreateWidget(delegate)); | 209 scoped_ptr<views::Widget> widget(CreateWidget(delegate)); |
209 | 210 |
210 const gfx::Rect initial = delegate-> | 211 const gfx::Rect initial = delegate-> |
211 GetFrameCaptionButtonContainerViewBounds(); | 212 GetFrameCaptionButtonContainerViewBounds(); |
212 Shell::GetInstance()->EnableMaximizeModeWindowManager(true); | 213 Shell::GetInstance()->maximize_mode_controller()-> |
| 214 EnableMaximizeModeWindowManager(true); |
213 const gfx::Rect maximize_mode_bounds = delegate-> | 215 const gfx::Rect maximize_mode_bounds = delegate-> |
214 GetFrameCaptionButtonContainerViewBounds(); | 216 GetFrameCaptionButtonContainerViewBounds(); |
215 EXPECT_GT(initial.width(), maximize_mode_bounds.width()); | 217 EXPECT_GT(initial.width(), maximize_mode_bounds.width()); |
216 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); | 218 Shell::GetInstance()->maximize_mode_controller()-> |
| 219 EnableMaximizeModeWindowManager(false); |
217 const gfx::Rect after_restore = delegate-> | 220 const gfx::Rect after_restore = delegate-> |
218 GetFrameCaptionButtonContainerViewBounds(); | 221 GetFrameCaptionButtonContainerViewBounds(); |
219 EXPECT_EQ(initial, after_restore); | 222 EXPECT_EQ(initial, after_restore); |
220 } | 223 } |
221 | 224 |
222 } // namespace ash | 225 } // namespace ash |
OLD | NEW |