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

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

Issue 907473002: Polish UI of bookmark app creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 5 years, 10 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 <string> 7 #include <string>
8 8
9 #include "ash/desktop_background/user_wallpaper_delegate.h" 9 #include "ash/desktop_background/user_wallpaper_delegate.h"
10 #include "ash/metrics/user_metrics_recorder.h" 10 #include "ash/metrics/user_metrics_recorder.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 AddItem(MENU_CLOSE, 103 AddItem(MENU_CLOSE,
104 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); 104 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE));
105 } 105 }
106 if (!controller_->IsPlatformApp(item_.id) && 106 if (!controller_->IsPlatformApp(item_.id) &&
107 item_.type != ash::TYPE_WINDOWED_APP) { 107 item_.type != ash::TYPE_WINDOWED_APP) {
108 AddSeparator(ui::NORMAL_SEPARATOR); 108 AddSeparator(ui::NORMAL_SEPARATOR);
109 if (extensions::util::IsNewBookmarkAppsEnabled()) { 109 if (extensions::util::IsNewBookmarkAppsEnabled()) {
110 // With bookmark apps enabled, hosted apps launch in a window by 110 // With bookmark apps enabled, hosted apps launch in a window by
111 // default. This menu item is re-interpreted as a single, toggle-able 111 // default. This menu item is re-interpreted as a single, toggle-able
112 // option to launch the hosted app as a tab. 112 // option to launch the hosted app as a tab.
113 AddCheckItemWithStringId( 113 AddCheckItemWithStringId(LAUNCH_TYPE_WINDOW,
114 LAUNCH_TYPE_REGULAR_TAB, 114 IDS_APP_CONTEXT_MENU_OPEN_WINDOW);
115 IDS_APP_CONTEXT_MENU_OPEN_TAB);
116 } else { 115 } else {
117 AddCheckItemWithStringId( 116 AddCheckItemWithStringId(
118 LAUNCH_TYPE_REGULAR_TAB, 117 LAUNCH_TYPE_REGULAR_TAB,
119 IDS_APP_CONTEXT_MENU_OPEN_REGULAR); 118 IDS_APP_CONTEXT_MENU_OPEN_REGULAR);
120 AddCheckItemWithStringId( 119 AddCheckItemWithStringId(
121 LAUNCH_TYPE_PINNED_TAB, 120 LAUNCH_TYPE_PINNED_TAB,
122 IDS_APP_CONTEXT_MENU_OPEN_PINNED); 121 IDS_APP_CONTEXT_MENU_OPEN_PINNED);
123 AddCheckItemWithStringId( 122 AddCheckItemWithStringId(
124 LAUNCH_TYPE_WINDOW, 123 LAUNCH_TYPE_WINDOW,
125 IDS_APP_CONTEXT_MENU_OPEN_WINDOW); 124 IDS_APP_CONTEXT_MENU_OPEN_WINDOW);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 break; 302 break;
304 case MENU_PIN: 303 case MENU_PIN:
305 controller_->TogglePinned(item_.id); 304 controller_->TogglePinned(item_.id);
306 break; 305 break;
307 case MENU_INSTALL: 306 case MENU_INSTALL:
308 controller_->Install(item_.id); 307 controller_->Install(item_.id);
309 break; 308 break;
310 case LAUNCH_TYPE_PINNED_TAB: 309 case LAUNCH_TYPE_PINNED_TAB:
311 controller_->SetLaunchType(item_.id, extensions::LAUNCH_TYPE_PINNED); 310 controller_->SetLaunchType(item_.id, extensions::LAUNCH_TYPE_PINNED);
312 break; 311 break;
313 case LAUNCH_TYPE_REGULAR_TAB: { 312 case LAUNCH_TYPE_REGULAR_TAB:
314 extensions::LaunchType launch_type = 313 controller_->SetLaunchType(item_.id, extensions::LAUNCH_TYPE_REGULAR);
315 extensions::LAUNCH_TYPE_REGULAR; 314 break;
315 case LAUNCH_TYPE_WINDOW: {
316 extensions::LaunchType launch_type = extensions::LAUNCH_TYPE_WINDOW;
316 // With bookmark apps enabled, hosted apps can only toggle between 317 // With bookmark apps enabled, hosted apps can only toggle between
317 // LAUNCH_WINDOW and LAUNCH_REGULAR. 318 // LAUNCH_WINDOW and LAUNCH_REGULAR.
318 if (extensions::util::IsNewBookmarkAppsEnabled()) { 319 if (extensions::util::IsNewBookmarkAppsEnabled()) {
319 launch_type = controller_->GetLaunchType(item_.id) == 320 launch_type = controller_->GetLaunchType(item_.id) ==
320 extensions::LAUNCH_TYPE_REGULAR 321 extensions::LAUNCH_TYPE_WINDOW
321 ? extensions::LAUNCH_TYPE_WINDOW 322 ? extensions::LAUNCH_TYPE_REGULAR
322 : extensions::LAUNCH_TYPE_REGULAR; 323 : extensions::LAUNCH_TYPE_WINDOW;
323 } 324 }
324 controller_->SetLaunchType(item_.id, launch_type); 325 controller_->SetLaunchType(item_.id, launch_type);
325 break; 326 break;
326 } 327 }
327 case LAUNCH_TYPE_WINDOW:
328 controller_->SetLaunchType(item_.id, extensions::LAUNCH_TYPE_WINDOW);
329 break;
330 case LAUNCH_TYPE_FULLSCREEN: 328 case LAUNCH_TYPE_FULLSCREEN:
331 controller_->SetLaunchType(item_.id, extensions::LAUNCH_TYPE_FULLSCREEN); 329 controller_->SetLaunchType(item_.id, extensions::LAUNCH_TYPE_FULLSCREEN);
332 break; 330 break;
333 case MENU_AUTO_HIDE: 331 case MENU_AUTO_HIDE:
334 controller_->ToggleShelfAutoHideBehavior(root_window_); 332 controller_->ToggleShelfAutoHideBehavior(root_window_);
335 break; 333 break;
336 case MENU_NEW_WINDOW: 334 case MENU_NEW_WINDOW:
337 controller_->CreateNewWindow(); 335 controller_->CreateNewWindow();
338 break; 336 break;
339 case MENU_NEW_INCOGNITO_WINDOW: 337 case MENU_NEW_INCOGNITO_WINDOW:
340 controller_->CreateNewIncognitoWindow(); 338 controller_->CreateNewIncognitoWindow();
341 break; 339 break;
342 case MENU_ALIGNMENT_MENU: 340 case MENU_ALIGNMENT_MENU:
343 break; 341 break;
344 #if defined(OS_CHROMEOS) 342 #if defined(OS_CHROMEOS)
345 case MENU_CHANGE_WALLPAPER: 343 case MENU_CHANGE_WALLPAPER:
346 ash::Shell::GetInstance()->user_wallpaper_delegate()-> 344 ash::Shell::GetInstance()->user_wallpaper_delegate()->
347 OpenSetWallpaperPage(); 345 OpenSetWallpaperPage();
348 break; 346 break;
349 #endif 347 #endif
350 default: 348 default:
351 extension_items_->ExecuteCommand(command_id, NULL, 349 extension_items_->ExecuteCommand(command_id, NULL,
352 content::ContextMenuParams()); 350 content::ContextMenuParams());
353 } 351 }
354 } 352 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_context_menu.cc ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698