| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" | 5 #include "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" |
| 6 | 6 |
| 7 #include "ash/multi_profile_uma.h" | 7 #include "ash/multi_profile_uma.h" |
| 8 #include "ash/session/session_state_delegate.h" | 8 #include "ash/session/session_state_delegate.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "ui/base/models/simple_menu_model.h" | 26 #include "ui/base/models/simple_menu_model.h" |
| 27 | 27 |
| 28 namespace chromeos { | 28 namespace chromeos { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 class MultiUserContextMenuChromeos : public ui::SimpleMenuModel, | 32 class MultiUserContextMenuChromeos : public ui::SimpleMenuModel, |
| 33 public ui::SimpleMenuModel::Delegate { | 33 public ui::SimpleMenuModel::Delegate { |
| 34 public: | 34 public: |
| 35 explicit MultiUserContextMenuChromeos(aura::Window* window); | 35 explicit MultiUserContextMenuChromeos(aura::Window* window); |
| 36 virtual ~MultiUserContextMenuChromeos() {} | 36 ~MultiUserContextMenuChromeos() override {} |
| 37 | 37 |
| 38 // SimpleMenuModel::Delegate: | 38 // SimpleMenuModel::Delegate: |
| 39 virtual bool IsCommandIdChecked(int command_id) const override { | 39 bool IsCommandIdChecked(int command_id) const override { return false; } |
| 40 bool IsCommandIdEnabled(int command_id) const override { return true; } |
| 41 bool GetAcceleratorForCommandId(int command_id, |
| 42 ui::Accelerator* accelerator) override { |
| 40 return false; | 43 return false; |
| 41 } | 44 } |
| 42 virtual bool IsCommandIdEnabled(int command_id) const override { | 45 void ExecuteCommand(int command_id, int event_flags) override; |
| 43 return true; | |
| 44 } | |
| 45 virtual bool GetAcceleratorForCommandId( | |
| 46 int command_id, | |
| 47 ui::Accelerator* accelerator) override { | |
| 48 return false; | |
| 49 } | |
| 50 virtual void ExecuteCommand(int command_id, int event_flags) override; | |
| 51 | 46 |
| 52 private: | 47 private: |
| 53 // The window for which this menu is. | 48 // The window for which this menu is. |
| 54 aura::Window* window_; | 49 aura::Window* window_; |
| 55 | 50 |
| 56 DISALLOW_COPY_AND_ASSIGN(MultiUserContextMenuChromeos); | 51 DISALLOW_COPY_AND_ASSIGN(MultiUserContextMenuChromeos); |
| 57 }; | 52 }; |
| 58 | 53 |
| 59 MultiUserContextMenuChromeos::MultiUserContextMenuChromeos(aura::Window* window) | 54 MultiUserContextMenuChromeos::MultiUserContextMenuChromeos(aura::Window* window) |
| 60 : ui::SimpleMenuModel(this), | 55 : ui::SimpleMenuModel(this), |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 return; | 139 return; |
| 145 } | 140 } |
| 146 } | 141 } |
| 147 chromeos::ShowMultiprofilesWarningDialog(on_accept); | 142 chromeos::ShowMultiprofilesWarningDialog(on_accept); |
| 148 return; | 143 return; |
| 149 } | 144 } |
| 150 default: | 145 default: |
| 151 NOTREACHED(); | 146 NOTREACHED(); |
| 152 } | 147 } |
| 153 } | 148 } |
| OLD | NEW |