| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h" |
| 6 |
| 7 #include "ash/shelf/shelf_item_types.h" |
| 8 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 9 #include "chrome/grit/generated_resources.h" |
| 10 |
| 11 ArcLauncherContextMenu::ArcLauncherContextMenu( |
| 12 ChromeLauncherController* controller, |
| 13 const ash::ShelfItem* item, |
| 14 ash::Shelf* shelf) |
| 15 : LauncherContextMenu(controller, item, shelf) { |
| 16 Init(); |
| 17 } |
| 18 |
| 19 ArcLauncherContextMenu::~ArcLauncherContextMenu() {} |
| 20 |
| 21 void ArcLauncherContextMenu::Init() { |
| 22 AddItemWithStringId(MENU_OPEN_NEW, IDS_APP_CONTEXT_MENU_ACTIVATE_ARC); |
| 23 AddSeparator(ui::NORMAL_SEPARATOR); |
| 24 AddPinMenu(); |
| 25 if (controller()->IsOpen(item().id)) |
| 26 AddItemWithStringId(MENU_CLOSE, IDS_LAUNCHER_CONTEXT_MENU_CLOSE); |
| 27 AddSeparator(ui::NORMAL_SEPARATOR); |
| 28 AddShelfOptionsMenu(); |
| 29 } |
| 30 |
| 31 bool ArcLauncherContextMenu::IsCommandIdEnabled(int command_id) const { |
| 32 if (command_id == MENU_OPEN_NEW) |
| 33 return true; |
| 34 return LauncherContextMenu::IsCommandIdEnabled(command_id); |
| 35 } |
| OLD | NEW |