OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_STATUS_MENU_MODEL_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_STATUS_MENU_MODEL_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/string16.h" |
| 10 #include "base/task.h" |
| 11 #include "ui/base/models/simple_menu_model.h" |
| 12 |
| 13 class Profile; |
| 14 |
| 15 // An implement of SimpleMenuModel which adds profile information when |
| 16 // executing a command. |
| 17 class ProfileStatusMenuModel : public ui::SimpleMenuModel { |
| 18 public: |
| 19 class Delegate : public ui::SimpleMenuModel::Delegate { |
| 20 public: |
| 21 // Performs the action associated with the specified command id. |
| 22 virtual void ExecuteCommand(int command_id, Profile* profile) = 0; |
| 23 |
| 24 protected: |
| 25 virtual ~Delegate() {} |
| 26 }; |
| 27 |
| 28 explicit ProfileStatusMenuModel(Delegate* delegate, Profile* profile); |
| 29 virtual ~ProfileStatusMenuModel(); |
| 30 |
| 31 virtual void ActivatedAt(int index) OVERRIDE; |
| 32 |
| 33 private: |
| 34 Delegate* delegate_; |
| 35 |
| 36 Profile* profile_; |
| 37 }; |
| 38 |
| 39 #endif // CHROME_BROWSER_PROFILES_PROFILE_STATUS_MENU_MODEL_H_ |
OLD | NEW |