Chromium Code Reviews| Index: chrome/browser/ui/ash/launcher/arc_launcher_context_menu.cc |
| diff --git a/chrome/browser/ui/ash/launcher/arc_launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/arc_launcher_context_menu.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9f5b4bed056b69939bee67a40ef23c2929387ea1 |
| --- /dev/null |
| +++ b/chrome/browser/ui/ash/launcher/arc_launcher_context_menu.cc |
| @@ -0,0 +1,43 @@ |
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h" |
| + |
| +#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
|
| + |
| +#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.
|
| +#include "ash/shelf/shelf_item_types.h" |
| +#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| +#include "chrome/common/pref_names.h" |
| +#include "chrome/grit/generated_resources.h" |
| +#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
|
| +#include "ui/base/l10n/l10n_util.h" |
| + |
| +ArcLauncherContextMenu::ArcLauncherContextMenu( |
| + ChromeLauncherController* controller, |
| + const ash::ShelfItem* item, |
| + ash::Shelf* shelf) |
| + : LauncherContextMenu(controller, item, shelf) { |
| + Init(); |
| +} |
| + |
| +ArcLauncherContextMenu::~ArcLauncherContextMenu() {} |
| + |
| +void ArcLauncherContextMenu::Init() { |
| + AddItem(MENU_OPEN_NEW, |
| + l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_ACTIVATE_ARC)); |
| + AddSeparator(ui::NORMAL_SEPARATOR); |
| + AddPinMenu(); |
| + if (controller()->IsOpen(item().id)) |
| + AddItem(MENU_CLOSE, |
| + l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE)); |
| + AddSeparator(ui::NORMAL_SEPARATOR); |
| + AddAutohideAlignmentWallpaperMenu(); |
| +} |
| + |
| +bool ArcLauncherContextMenu::IsCommandIdEnabled(int command_id) const { |
| + if (command_id == MENU_OPEN_NEW) |
| + return true; |
| + return LauncherContextMenu::IsCommandIdEnabled(command_id); |
| +} |