Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: ash/sysui/context_menu_mus.cc

Issue 2271373002: mash: Port mojo:ash_sysui's ContextMenuMus to mojo:ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/sysui/context_menu_mus.h ('k') | ash/sysui/shell_delegate_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/sysui/context_menu_mus.cc
diff --git a/ash/sysui/context_menu_mus.cc b/ash/sysui/context_menu_mus.cc
deleted file mode 100644
index 73207030592efbee737c4f466ff654159767bc92..0000000000000000000000000000000000000000
--- a/ash/sysui/context_menu_mus.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 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 "ash/sysui/context_menu_mus.h"
-
-#include "ash/common/shelf/shelf_types.h"
-#include "ash/common/shelf/wm_shelf.h"
-#include "ash/desktop_background/user_wallpaper_delegate.h"
-#include "ash/shell.h"
-#include "grit/ash_strings.h"
-
-namespace ash {
-
-ContextMenuMus::ContextMenuMus(WmShelf* wm_shelf)
- : ui::SimpleMenuModel(nullptr),
- wm_shelf_(wm_shelf),
- alignment_menu_(wm_shelf) {
- set_delegate(this);
- AddCheckItemWithStringId(MENU_AUTO_HIDE,
- IDS_ASH_SHELF_CONTEXT_MENU_AUTO_HIDE);
- AddSubMenuWithStringId(MENU_ALIGNMENT_MENU,
- IDS_ASH_SHELF_CONTEXT_MENU_POSITION, &alignment_menu_);
-#if defined(OS_CHROMEOS)
- AddItemWithStringId(MENU_CHANGE_WALLPAPER, IDS_AURA_SET_DESKTOP_WALLPAPER);
-#endif
-}
-
-ContextMenuMus::~ContextMenuMus() {}
-
-bool ContextMenuMus::IsCommandIdChecked(int command_id) const {
- if (command_id == MENU_AUTO_HIDE)
- return wm_shelf_->auto_hide_behavior() == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
- return false;
-}
-
-bool ContextMenuMus::IsCommandIdEnabled(int command_id) const {
- Shell* shell = Shell::GetInstance();
- if (command_id == MENU_CHANGE_WALLPAPER)
- return shell->user_wallpaper_delegate()->CanOpenSetWallpaperPage();
- return true;
-}
-
-void ContextMenuMus::ExecuteCommand(int command_id, int event_flags) {
- if (command_id == MENU_AUTO_HIDE) {
- wm_shelf_->SetAutoHideBehavior(wm_shelf_->auto_hide_behavior() ==
- SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
- ? SHELF_AUTO_HIDE_BEHAVIOR_NEVER
- : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
- } else if (command_id == MENU_CHANGE_WALLPAPER) {
- Shell::GetInstance()->user_wallpaper_delegate()->OpenSetWallpaperPage();
- }
-}
-
-} // namespace ash
« no previous file with comments | « ash/sysui/context_menu_mus.h ('k') | ash/sysui/shell_delegate_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698