| OLD | NEW |
| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 l10n_util::GetStringUTF16(controller_->IsPinned(item_.id) ? | 99 l10n_util::GetStringUTF16(controller_->IsPinned(item_.id) ? |
| 100 IDS_LAUNCHER_CONTEXT_MENU_UNPIN : | 100 IDS_LAUNCHER_CONTEXT_MENU_UNPIN : |
| 101 IDS_LAUNCHER_CONTEXT_MENU_PIN)); | 101 IDS_LAUNCHER_CONTEXT_MENU_PIN)); |
| 102 if (controller_->IsOpen(item_.id)) { | 102 if (controller_->IsOpen(item_.id)) { |
| 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::IsStreamlinedHostedAppsEnabled()) { | 109 if (extensions::util::IsNewBookmarkAppsEnabled()) { |
| 110 // Streamlined hosted apps launch in a window by default. This menu | 110 // With bookmark apps enabled, hosted apps launch in a window by |
| 111 // item is re-interpreted as a single, toggle-able option to launch | 111 // default. This menu item is re-interpreted as a single, toggle-able |
| 112 // the hosted app as a tab. | 112 // option to launch the hosted app as a tab. |
| 113 AddCheckItemWithStringId( | 113 AddCheckItemWithStringId( |
| 114 LAUNCH_TYPE_REGULAR_TAB, | 114 LAUNCH_TYPE_REGULAR_TAB, |
| 115 IDS_APP_CONTEXT_MENU_OPEN_TAB); | 115 IDS_APP_CONTEXT_MENU_OPEN_TAB); |
| 116 } else { | 116 } else { |
| 117 AddCheckItemWithStringId( | 117 AddCheckItemWithStringId( |
| 118 LAUNCH_TYPE_REGULAR_TAB, | 118 LAUNCH_TYPE_REGULAR_TAB, |
| 119 IDS_APP_CONTEXT_MENU_OPEN_REGULAR); | 119 IDS_APP_CONTEXT_MENU_OPEN_REGULAR); |
| 120 AddCheckItemWithStringId( | 120 AddCheckItemWithStringId( |
| 121 LAUNCH_TYPE_PINNED_TAB, | 121 LAUNCH_TYPE_PINNED_TAB, |
| 122 IDS_APP_CONTEXT_MENU_OPEN_PINNED); | 122 IDS_APP_CONTEXT_MENU_OPEN_PINNED); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 break; | 306 break; |
| 307 case MENU_INSTALL: | 307 case MENU_INSTALL: |
| 308 controller_->Install(item_.id); | 308 controller_->Install(item_.id); |
| 309 break; | 309 break; |
| 310 case LAUNCH_TYPE_PINNED_TAB: | 310 case LAUNCH_TYPE_PINNED_TAB: |
| 311 controller_->SetLaunchType(item_.id, extensions::LAUNCH_TYPE_PINNED); | 311 controller_->SetLaunchType(item_.id, extensions::LAUNCH_TYPE_PINNED); |
| 312 break; | 312 break; |
| 313 case LAUNCH_TYPE_REGULAR_TAB: { | 313 case LAUNCH_TYPE_REGULAR_TAB: { |
| 314 extensions::LaunchType launch_type = | 314 extensions::LaunchType launch_type = |
| 315 extensions::LAUNCH_TYPE_REGULAR; | 315 extensions::LAUNCH_TYPE_REGULAR; |
| 316 // Streamlined hosted apps can only toggle between LAUNCH_WINDOW and | 316 // With bookmark apps enabled, hosted apps can only toggle between |
| 317 // LAUNCH_REGULAR. | 317 // LAUNCH_WINDOW and LAUNCH_REGULAR. |
| 318 if (extensions::util::IsStreamlinedHostedAppsEnabled()) { | 318 if (extensions::util::IsNewBookmarkAppsEnabled()) { |
| 319 launch_type = controller_->GetLaunchType(item_.id) == | 319 launch_type = controller_->GetLaunchType(item_.id) == |
| 320 extensions::LAUNCH_TYPE_REGULAR | 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 } | 323 } |
| 324 controller_->SetLaunchType(item_.id, launch_type); | 324 controller_->SetLaunchType(item_.id, launch_type); |
| 325 break; | 325 break; |
| 326 } | 326 } |
| 327 case LAUNCH_TYPE_WINDOW: | 327 case LAUNCH_TYPE_WINDOW: |
| 328 controller_->SetLaunchType(item_.id, extensions::LAUNCH_TYPE_WINDOW); | 328 controller_->SetLaunchType(item_.id, extensions::LAUNCH_TYPE_WINDOW); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 345 case MENU_CHANGE_WALLPAPER: | 345 case MENU_CHANGE_WALLPAPER: |
| 346 ash::Shell::GetInstance()->user_wallpaper_delegate()-> | 346 ash::Shell::GetInstance()->user_wallpaper_delegate()-> |
| 347 OpenSetWallpaperPage(); | 347 OpenSetWallpaperPage(); |
| 348 break; | 348 break; |
| 349 #endif | 349 #endif |
| 350 default: | 350 default: |
| 351 extension_items_->ExecuteCommand(command_id, NULL, | 351 extension_items_->ExecuteCommand(command_id, NULL, |
| 352 content::ContextMenuParams()); | 352 content::ContextMenuParams()); |
| 353 } | 353 } |
| 354 } | 354 } |
| OLD | NEW |