| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/mus/context_menu_mus.h" | 5 #include "ash/mus/context_menu_mus.h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/wm_shelf.h" | 7 #include "ash/common/shelf/wm_shelf.h" |
| 8 #include "ash/common/wallpaper/wallpaper_controller.h" | 8 #include "ash/common/wallpaper/wallpaper_controller.h" |
| 9 #include "ash/common/wallpaper/wallpaper_delegate.h" | 9 #include "ash/common/wallpaper/wallpaper_delegate.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| 11 #include "ash/public/cpp/shelf_types.h" | 11 #include "ash/public/cpp/shelf_types.h" |
| 12 #include "ash/shell.h" |
| 12 #include "ash/strings/grit/ash_strings.h" | 13 #include "ash/strings/grit/ash_strings.h" |
| 13 | 14 |
| 14 namespace ash { | 15 namespace ash { |
| 15 | 16 |
| 16 ContextMenuMus::ContextMenuMus(WmShelf* wm_shelf) | 17 ContextMenuMus::ContextMenuMus(WmShelf* wm_shelf) |
| 17 : ui::SimpleMenuModel(nullptr), | 18 : ui::SimpleMenuModel(nullptr), |
| 18 wm_shelf_(wm_shelf), | 19 wm_shelf_(wm_shelf), |
| 19 alignment_menu_(wm_shelf) { | 20 alignment_menu_(wm_shelf) { |
| 20 set_delegate(this); | 21 set_delegate(this); |
| 21 AddCheckItemWithStringId(MENU_AUTO_HIDE, | 22 AddCheckItemWithStringId(MENU_AUTO_HIDE, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 39 return true; | 40 return true; |
| 40 } | 41 } |
| 41 | 42 |
| 42 void ContextMenuMus::ExecuteCommand(int command_id, int event_flags) { | 43 void ContextMenuMus::ExecuteCommand(int command_id, int event_flags) { |
| 43 if (command_id == MENU_AUTO_HIDE) { | 44 if (command_id == MENU_AUTO_HIDE) { |
| 44 wm_shelf_->SetAutoHideBehavior(wm_shelf_->auto_hide_behavior() == | 45 wm_shelf_->SetAutoHideBehavior(wm_shelf_->auto_hide_behavior() == |
| 45 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS | 46 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS |
| 46 ? SHELF_AUTO_HIDE_BEHAVIOR_NEVER | 47 ? SHELF_AUTO_HIDE_BEHAVIOR_NEVER |
| 47 : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 48 : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 48 } else if (command_id == MENU_CHANGE_WALLPAPER) { | 49 } else if (command_id == MENU_CHANGE_WALLPAPER) { |
| 49 WmShell::Get()->wallpaper_controller()->OpenSetWallpaperPage(); | 50 Shell::GetInstance()->wallpaper_controller()->OpenSetWallpaperPage(); |
| 50 } | 51 } |
| 51 } | 52 } |
| 52 | 53 |
| 53 } // namespace ash | 54 } // namespace ash |
| OLD | NEW |