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

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc

Issue 308683002: Move MaximizeModeWindowManager to the controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/ui/ash/launcher/launcher_context_menu.h" 5 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h"
6 6
7 #include "ash/shelf/shelf.h" 7 #include "ash/shelf/shelf.h"
8 #include "ash/shelf/shelf_item_types.h" 8 #include "ash/shelf/shelf_item_types.h"
9 #include "ash/shelf/shelf_model.h" 9 #include "ash/shelf/shelf_model.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/test/ash_test_base.h" 11 #include "ash/test/ash_test_base.h"
12 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
12 #include "base/prefs/pref_service.h" 13 #include "base/prefs/pref_service.h"
13 #include "chrome/app/chrome_command_ids.h" 14 #include "chrome/app/chrome_command_ids.h"
14 #include "chrome/browser/prefs/incognito_mode_prefs.h" 15 #include "chrome/browser/prefs/incognito_mode_prefs.h"
15 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 17 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
17 #include "chrome/test/base/testing_profile.h" 18 #include "chrome/test/base/testing_profile.h"
18 #include "ui/aura/window_event_dispatcher.h" 19 #include "ui/aura/window_event_dispatcher.h"
19 20
20 class TestChromeLauncherController : public ChromeLauncherController { 21 class TestChromeLauncherController : public ChromeLauncherController {
21 public: 22 public:
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 112 }
112 113
113 // Verifies that the "auto hide" menu items are not present in maximized mode. 114 // Verifies that the "auto hide" menu items are not present in maximized mode.
114 TEST_F(LauncherContextMenuTest, NoAutoHideOptionInMaximizedMode) { 115 TEST_F(LauncherContextMenuTest, NoAutoHideOptionInMaximizedMode) {
115 { 116 {
116 scoped_ptr<LauncherContextMenu> menu( 117 scoped_ptr<LauncherContextMenu> menu(
117 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT)); 118 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT));
118 ASSERT_TRUE(IsItemPresentInMenu( 119 ASSERT_TRUE(IsItemPresentInMenu(
119 menu.get(), LauncherContextMenu::MENU_AUTO_HIDE)); 120 menu.get(), LauncherContextMenu::MENU_AUTO_HIDE));
120 } 121 }
121 ash::Shell::GetInstance()->EnableMaximizeModeWindowManager(true); 122 ash::Shell::GetInstance()->maximize_mode_controller()->
123 EnableMaximizeModeWindowManager(true);
122 { 124 {
123 scoped_ptr<LauncherContextMenu> menu( 125 scoped_ptr<LauncherContextMenu> menu(
124 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT)); 126 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT));
125 ASSERT_FALSE(IsItemPresentInMenu( 127 ASSERT_FALSE(IsItemPresentInMenu(
126 menu.get(), LauncherContextMenu::MENU_AUTO_HIDE)); 128 menu.get(), LauncherContextMenu::MENU_AUTO_HIDE));
127 } 129 }
128 ash::Shell::GetInstance()->EnableMaximizeModeWindowManager(false); 130 ash::Shell::GetInstance()->maximize_mode_controller()->
131 EnableMaximizeModeWindowManager(false);
129 { 132 {
130 scoped_ptr<LauncherContextMenu> menu( 133 scoped_ptr<LauncherContextMenu> menu(
131 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT)); 134 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT));
132 ASSERT_TRUE(IsItemPresentInMenu( 135 ASSERT_TRUE(IsItemPresentInMenu(
133 menu.get(), LauncherContextMenu::MENU_AUTO_HIDE)); 136 menu.get(), LauncherContextMenu::MENU_AUTO_HIDE));
134 } 137 }
135 } 138 }
136 139
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698