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

Side by Side Diff: ash/frame/custom_frame_view_ash_unittest.cc

Issue 308683002: Move MaximizeModeWindowManager to the controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 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
« no previous file with comments | « ash/frame/custom_frame_view_ash.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/frame/custom_frame_view_ash.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698