| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "ui/base/models/menu_model.h" | 14 #include "ui/base/models/menu_model.h" |
| 15 #include "views/controls/menu/menu_model_adapter.h" | 15 #include "views/controls/menu/menu_model_adapter.h" |
| 16 | 16 |
| 17 class Profile; | 17 class Profile; |
| 18 | 18 |
| 19 class AvatarMenu : public base::RefCounted<AvatarMenu>, | 19 class AvatarMenu : public base::RefCounted<AvatarMenu>, |
| 20 public views::MenuModelAdapter { | 20 public views::MenuModelAdapter { |
| 21 public: | 21 public: |
| 22 AvatarMenu(ui::MenuModel* model, Profile* profile); | 22 AvatarMenu(ui::MenuModel* model, Profile* profile); |
| 23 ~AvatarMenu(); | 23 virtual ~AvatarMenu(); |
| 24 | 24 |
| 25 // Shows the menu relative to the specified view. | 25 // Shows the menu relative to the specified view. |
| 26 void RunMenu(views::MenuButton* host); | 26 void RunMenu(views::MenuButton* host); |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 // The views menu. | 29 // The views menu. |
| 30 scoped_ptr<views::MenuItemView> root_; | 30 scoped_ptr<views::MenuItemView> root_; |
| 31 | 31 |
| 32 // Profile the menu is being shown for. | 32 // Profile the menu is being shown for. |
| 33 Profile* profile_; | 33 Profile* profile_; |
| 34 | 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(AvatarMenu); | 35 DISALLOW_COPY_AND_ASSIGN(AvatarMenu); |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_H_ | 38 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_H_ |
| OLD | NEW |