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

Side by Side Diff: chrome/browser/ui/app_list/app_context_menu_unittest.cc

Issue 2131463002: Purge the App Launcher code from Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Zap mac-specific icon assets 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 #include <unordered_set> 7 #include <unordered_set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 pinnable != AppListControllerDelegate::PIN_FIXED, 212 pinnable != AppListControllerDelegate::PIN_FIXED,
213 false)); 213 false));
214 } 214 }
215 if (can_create_shortcuts) 215 if (can_create_shortcuts)
216 states.push_back(MenuState(app_list::AppContextMenu::CREATE_SHORTCUTS)); 216 states.push_back(MenuState(app_list::AppContextMenu::CREATE_SHORTCUTS));
217 AddSeparator(states); 217 AddSeparator(states);
218 218
219 if (!platform_app) { 219 if (!platform_app) {
220 if (extensions::util::CanHostedAppsOpenInWindows() && 220 if (extensions::util::CanHostedAppsOpenInWindows() &&
221 extensions::util::IsNewBookmarkAppsEnabled()) { 221 extensions::util::IsNewBookmarkAppsEnabled()) {
222 // MACOS has different logic for this case. 222 bool checked = launch_type == extensions::LAUNCH_TYPE_WINDOW ||
223 // See chrome/browser/extensions/launch_util.cc for more details. 223 launch_type == extensions::LAUNCH_TYPE_FULLSCREEN;
224 bool checked = launch_type == extensions::LAUNCH_TYPE_WINDOW;
225 #if !defined(OS_MACOSX)
226 checked |= launch_type == extensions::LAUNCH_TYPE_FULLSCREEN;
227 #endif
228 states.push_back(MenuState( 224 states.push_back(MenuState(
229 app_list::AppContextMenu::USE_LAUNCH_TYPE_WINDOW, true, checked)); 225 app_list::AppContextMenu::USE_LAUNCH_TYPE_WINDOW, true, checked));
230 } else if (!extensions::util::IsNewBookmarkAppsEnabled()) { 226 } else if (!extensions::util::IsNewBookmarkAppsEnabled()) {
231 bool regular_checked = launch_type == extensions::LAUNCH_TYPE_REGULAR; 227 bool regular_checked = launch_type == extensions::LAUNCH_TYPE_REGULAR;
232 #if defined(OS_MACOSX)
233 regular_checked |= (!extensions::util::CanHostedAppsOpenInWindows() &&
234 launch_type == extensions::LAUNCH_TYPE_WINDOW);
235 #endif
236 states.push_back(MenuState( 228 states.push_back(MenuState(
237 app_list::AppContextMenu::USE_LAUNCH_TYPE_REGULAR, 229 app_list::AppContextMenu::USE_LAUNCH_TYPE_REGULAR,
238 true, 230 true,
239 regular_checked)); 231 regular_checked));
240 states.push_back(MenuState( 232 states.push_back(MenuState(
241 app_list::AppContextMenu::USE_LAUNCH_TYPE_PINNED, 233 app_list::AppContextMenu::USE_LAUNCH_TYPE_PINNED,
242 true, 234 true,
243 launch_type == extensions::LAUNCH_TYPE_PINNED)); 235 launch_type == extensions::LAUNCH_TYPE_PINNED));
244 if (extensions::util::CanHostedAppsOpenInWindows()) { 236 if (extensions::util::CanHostedAppsOpenInWindows()) {
245 states.push_back(MenuState( 237 states.push_back(MenuState(
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 EXPECT_EQ(-1, menu->GetCommandIdAt(3)); // separator 467 EXPECT_EQ(-1, menu->GetCommandIdAt(3)); // separator
476 EXPECT_EQ(app_list::AppContextMenu::UNINSTALL, menu->GetCommandIdAt(4)); 468 EXPECT_EQ(app_list::AppContextMenu::UNINSTALL, menu->GetCommandIdAt(4));
477 EXPECT_TRUE(menu->IsEnabledAt(4)); 469 EXPECT_TRUE(menu->IsEnabledAt(4));
478 EXPECT_FALSE(menu->IsItemCheckedAt(4)); 470 EXPECT_FALSE(menu->IsItemCheckedAt(4));
479 EXPECT_EQ(app_list::AppContextMenu::SHOW_APP_INFO, menu->GetCommandIdAt(5)); 471 EXPECT_EQ(app_list::AppContextMenu::SHOW_APP_INFO, menu->GetCommandIdAt(5));
480 EXPECT_TRUE(menu->IsEnabledAt(5)); 472 EXPECT_TRUE(menu->IsEnabledAt(5));
481 EXPECT_FALSE(menu->IsItemCheckedAt(5)); 473 EXPECT_FALSE(menu->IsItemCheckedAt(5));
482 } 474 }
483 } 475 }
484 #endif 476 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698