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

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

Issue 2113053003: Moves Shell::maximize_mode_controller() to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: order Created 4 years, 5 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
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 <memory> 7 #include <memory>
8 8
9 #include "ash/common/ash_layout_constants.h" 9 #include "ash/common/ash_layout_constants.h"
10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 // The visibility of the size button is updated when maximize mode is toggled. 201 // The visibility of the size button is updated when maximize mode is toggled.
202 // Verify that the layout of the HeaderView is updated for the size button's 202 // Verify that the layout of the HeaderView is updated for the size button's
203 // new visibility. 203 // new visibility.
204 TEST_F(CustomFrameViewAshTest, HeaderViewNotifiedOfChildSizeChange) { 204 TEST_F(CustomFrameViewAshTest, HeaderViewNotifiedOfChildSizeChange) {
205 TestWidgetConstraintsDelegate* delegate = new TestWidgetConstraintsDelegate; 205 TestWidgetConstraintsDelegate* delegate = new TestWidgetConstraintsDelegate;
206 std::unique_ptr<views::Widget> widget(CreateWidget(delegate)); 206 std::unique_ptr<views::Widget> widget(CreateWidget(delegate));
207 207
208 const gfx::Rect initial = 208 const gfx::Rect initial =
209 delegate->GetFrameCaptionButtonContainerViewBounds(); 209 delegate->GetFrameCaptionButtonContainerViewBounds();
210 Shell::GetInstance() 210 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
211 ->maximize_mode_controller() 211 true);
212 ->EnableMaximizeModeWindowManager(true);
213 delegate->EndFrameCaptionButtonContainerViewAnimations(); 212 delegate->EndFrameCaptionButtonContainerViewAnimations();
214 const gfx::Rect maximize_mode_bounds = 213 const gfx::Rect maximize_mode_bounds =
215 delegate->GetFrameCaptionButtonContainerViewBounds(); 214 delegate->GetFrameCaptionButtonContainerViewBounds();
216 EXPECT_GT(initial.width(), maximize_mode_bounds.width()); 215 EXPECT_GT(initial.width(), maximize_mode_bounds.width());
217 Shell::GetInstance() 216 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
218 ->maximize_mode_controller() 217 false);
219 ->EnableMaximizeModeWindowManager(false);
220 delegate->EndFrameCaptionButtonContainerViewAnimations(); 218 delegate->EndFrameCaptionButtonContainerViewAnimations();
221 const gfx::Rect after_restore = 219 const gfx::Rect after_restore =
222 delegate->GetFrameCaptionButtonContainerViewBounds(); 220 delegate->GetFrameCaptionButtonContainerViewBounds();
223 EXPECT_EQ(initial, after_restore); 221 EXPECT_EQ(initial, after_restore);
224 } 222 }
225 223
226 } // namespace ash 224 } // namespace ash
OLDNEW
« no previous file with comments | « ash/frame/caption_buttons/frame_caption_button_container_view_unittest.cc ('k') | ash/mus/bridge/wm_shell_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698