Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 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 <string> | |
|
khmel
2016/03/29 22:11:17
Do you really use std::string?
lgcheng
2016/03/30 00:01:53
Removed. Removed for other .cc when not used
| |
| 8 | |
| 9 #include "ash/shelf/shelf.h" | |
|
khmel
2016/03/29 22:11:17
Please check unused headers, I see only controller
lgcheng
2016/03/30 00:01:53
Done.
| |
| 10 #include "ash/shelf/shelf_item_types.h" | |
| 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | |
| 12 #include "chrome/common/pref_names.h" | |
| 13 #include "chrome/grit/generated_resources.h" | |
| 14 #include "grit/ash_strings.h" | |
|
khmel
2016/03/29 22:11:17
Used?
lgcheng
2016/03/30 00:01:53
Removed. Removed for other .cc when not used
| |
| 15 #include "ui/base/l10n/l10n_util.h" | |
| 16 | |
| 17 ArcLauncherContextMenu::ArcLauncherContextMenu( | |
| 18 ChromeLauncherController* controller, | |
| 19 const ash::ShelfItem* item, | |
| 20 ash::Shelf* shelf) | |
| 21 : LauncherContextMenu(controller, item, shelf) { | |
| 22 Init(); | |
| 23 } | |
| 24 | |
| 25 ArcLauncherContextMenu::~ArcLauncherContextMenu() {} | |
| 26 | |
| 27 void ArcLauncherContextMenu::Init() { | |
| 28 AddItem(MENU_OPEN_NEW, | |
| 29 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_ACTIVATE_ARC)); | |
| 30 AddSeparator(ui::NORMAL_SEPARATOR); | |
| 31 AddPinMenu(); | |
| 32 if (controller()->IsOpen(item().id)) | |
| 33 AddItem(MENU_CLOSE, | |
| 34 l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); | |
| 35 AddSeparator(ui::NORMAL_SEPARATOR); | |
| 36 AddAutohideAlignmentWallpaperMenu(); | |
| 37 } | |
| 38 | |
| 39 bool ArcLauncherContextMenu::IsCommandIdEnabled(int command_id) const { | |
| 40 if (command_id == MENU_OPEN_NEW) | |
| 41 return true; | |
| 42 return LauncherContextMenu::IsCommandIdEnabled(command_id); | |
| 43 } | |
| OLD | NEW |