Chromium Code Reviews| Index: chrome/browser/profiles/profile_status_menu_model.h |
| =================================================================== |
| --- chrome/browser/profiles/profile_status_menu_model.h (revision 0) |
| +++ chrome/browser/profiles/profile_status_menu_model.h (revision 0) |
| @@ -0,0 +1,39 @@ |
| +// Copyright (c) 2011 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. |
| + |
| +#ifndef CHROME_BROWSER_PROFILES_PROFILE_STATUS_MENU_MODEL_H_ |
| +#define CHROME_BROWSER_PROFILES_PROFILE_STATUS_MENU_MODEL_H_ |
|
Andrew T Wilson (Slow)
2011/05/20 00:22:09
I'm not sure this is heavy-weight enough to deserv
rpetterson
2011/05/20 05:53:17
So the real reason that it is its own class is bec
Miranda Callahan
2011/05/20 15:20:17
Actually, I think that my menu class needs a vecto
|
| +#pragma once |
| + |
| +#include "base/string16.h" |
| +#include "base/task.h" |
| +#include "ui/base/models/simple_menu_model.h" |
| + |
| +class Profile; |
| + |
| +// An implement of SimpleMenuModel which adds profile information when |
| +// executing a command. |
| +class ProfileStatusMenuModel : public ui::SimpleMenuModel { |
| + public: |
| + class Delegate : public ui::SimpleMenuModel::Delegate { |
| + public: |
| + // Performs the action associated with the specified command id. |
| + virtual void ExecuteCommand(int command_id, Profile* profile) = 0; |
| + |
| + protected: |
| + virtual ~Delegate() {} |
| + }; |
| + |
| + explicit ProfileStatusMenuModel(Delegate* delegate, Profile* profile); |
| + virtual ~ProfileStatusMenuModel(); |
| + |
| + virtual void ActivatedAt(int index) OVERRIDE; |
| + |
| + private: |
| + Delegate* delegate_; |
| + |
| + Profile* profile_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_PROFILES_PROFILE_MENU_MODEL_H_ |