| Index: chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.cc
|
| diff --git a/chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f8c85cd1d9d339d66995d2b974ff3d2d90f8706d
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/ash/launcher/desktop_shell_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/desktop_shell_launcher_context_menu.h"
|
| +
|
| +#include <string>
|
| +
|
| +#include "ash/desktop_background/user_wallpaper_delegate.h"
|
| +#include "ash/shelf/shelf.h"
|
| +#include "ash/shelf/shelf_item_types.h"
|
| +#include "ash/shell.h"
|
| +#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
|
| +
|
| +DesktopShellLauncherContextMenu::DesktopShellLauncherContextMenu(
|
| + ChromeLauncherController* controller,
|
| + const ash::ShelfItem* item,
|
| + ash::Shelf* shelf)
|
| + : LauncherContextMenu(controller, item, shelf) {
|
| + Init();
|
| +}
|
| +
|
| +DesktopShellLauncherContextMenu::~DesktopShellLauncherContextMenu() {}
|
| +
|
| +void DesktopShellLauncherContextMenu::Init() {
|
| + AddAutohideAlignmentWallpaperMenu();
|
| +}
|
| +
|
| +bool DesktopShellLauncherContextMenu::IsCommandIdEnabled(int command_id) const {
|
| + switch (command_id) {
|
| + case MENU_CHANGE_WALLPAPER:
|
| + return ash::Shell::GetInstance()
|
| + ->user_wallpaper_delegate()
|
| + ->CanOpenSetWallpaperPage();
|
| + case MENU_AUTO_HIDE:
|
| + return CanUserModifyShelfAutoHideBehavior();
|
| + case MENU_ALIGNMENT_MENU:
|
| + return true;
|
| + default:
|
| + NOTREACHED();
|
| + return false;
|
| + }
|
| +}
|
|
|