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

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

Issue 1300763002: Add a flag to enable open in window for hosted apps on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@disable-new-bookmark-apps
Patch Set: Addressing reviewer feedback Created 5 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/app_list/app_context_menu.h" 5 #include "chrome/browser/ui/app_list/app_context_menu.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/extensions/context_menu_matcher.h" 8 #include "chrome/browser/extensions/context_menu_matcher.h"
9 #include "chrome/browser/extensions/extension_util.h" 9 #include "chrome/browser/extensions/extension_util.h"
10 #include "chrome/browser/extensions/menu_manager.h" 10 #include "chrome/browser/extensions/menu_manager.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 IDS_APP_LIST_CONTEXT_MENU_PIN); 108 IDS_APP_LIST_CONTEXT_MENU_PIN);
109 } 109 }
110 110
111 if (controller_->CanDoCreateShortcutsFlow()) { 111 if (controller_->CanDoCreateShortcutsFlow()) {
112 menu_model_->AddItemWithStringId(CREATE_SHORTCUTS, 112 menu_model_->AddItemWithStringId(CREATE_SHORTCUTS,
113 IDS_NEW_TAB_APP_CREATE_SHORTCUT); 113 IDS_NEW_TAB_APP_CREATE_SHORTCUT);
114 } 114 }
115 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); 115 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
116 116
117 if (!is_platform_app_) { 117 if (!is_platform_app_) {
118 // When bookmark apps are enabled, hosted apps can only toggle between 118 if (extensions::util::CanHostedAppsOpenInWindows()) {
benwells 2015/08/19 05:44:54 This logic looks nice and simple now, but I think
dominickn 2015/08/19 06:29:04 Done.
119 // USE_LAUNCH_TYPE_WINDOW and USE_LAUNCH_TYPE_REGULAR. 119 menu_model_->AddCheckItemWithStringId(
120 if (extensions::util::IsNewBookmarkAppsEnabled()) { 120 USE_LAUNCH_TYPE_WINDOW, IDS_APP_CONTEXT_MENU_OPEN_WINDOW);
121 menu_model_->AddCheckItemWithStringId(USE_LAUNCH_TYPE_WINDOW,
122 IDS_APP_CONTEXT_MENU_OPEN_WINDOW);
123 } else { 121 } else {
124 menu_model_->AddCheckItemWithStringId( 122 menu_model_->AddCheckItemWithStringId(
125 USE_LAUNCH_TYPE_REGULAR, 123 USE_LAUNCH_TYPE_REGULAR,
126 IDS_APP_CONTEXT_MENU_OPEN_REGULAR); 124 IDS_APP_CONTEXT_MENU_OPEN_REGULAR);
127 menu_model_->AddCheckItemWithStringId( 125 menu_model_->AddCheckItemWithStringId(
128 USE_LAUNCH_TYPE_PINNED, 126 USE_LAUNCH_TYPE_PINNED,
129 IDS_APP_CONTEXT_MENU_OPEN_PINNED); 127 IDS_APP_CONTEXT_MENU_OPEN_PINNED);
130 #if defined(OS_MACOSX) 128 #if defined(OS_MACOSX)
131 // Mac does not support standalone web app browser windows or maximize. 129 // Mac does not support standalone web app browser windows or maximize.
132 menu_model_->AddCheckItemWithStringId( 130 menu_model_->AddCheckItemWithStringId(
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 extension_menu_items_->ExecuteCommand(command_id, NULL, 286 extension_menu_items_->ExecuteCommand(command_id, NULL,
289 content::ContextMenuParams()); 287 content::ContextMenuParams());
290 } else if (command_id == MENU_NEW_WINDOW) { 288 } else if (command_id == MENU_NEW_WINDOW) {
291 controller_->CreateNewWindow(profile_, false); 289 controller_->CreateNewWindow(profile_, false);
292 } else if (command_id == MENU_NEW_INCOGNITO_WINDOW) { 290 } else if (command_id == MENU_NEW_INCOGNITO_WINDOW) {
293 controller_->CreateNewWindow(profile_, true); 291 controller_->CreateNewWindow(profile_, true);
294 } 292 }
295 } 293 }
296 294
297 } // namespace app_list 295 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698