Chromium Code Reviews| 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_PROFILES_AVATAR_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_AVATAR_MENU_MODEL_H_ |
| 6 #define CHROME_BROWSER_PROFILES_AVATAR_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_PROFILES_AVATAR_MENU_MODEL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
| 14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
| 15 #include "ui/gfx/image/image.h" | |
| 15 | 16 |
| 16 class AvatarMenuModelObserver; | 17 class AvatarMenuModelObserver; |
| 17 class Browser; | 18 class Browser; |
| 18 class ProfileInfoInterface; | 19 class ProfileInfoInterface; |
| 19 | 20 |
| 20 namespace gfx { | 21 namespace gfx { |
| 21 class Image; | 22 class Image; |
|
Miranda Callahan
2011/11/28 14:56:48
you can remove the forward-decl.
sail
2011/11/28 15:25:16
Done.
| |
| 22 } | 23 } |
| 23 | 24 |
| 24 // This class is the model for the menu-like interface that appears when the | 25 // This class is the model for the menu-like interface that appears when the |
| 25 // avatar icon is clicked in the browser window frame. This class will notify | 26 // avatar icon is clicked in the browser window frame. This class will notify |
| 26 // its observer when the backend data changes, and the controller/view for this | 27 // its observer when the backend data changes, and the controller/view for this |
| 27 // model should forward actions back to it in response to user events. | 28 // model should forward actions back to it in response to user events. |
| 28 class AvatarMenuModel : public content::NotificationObserver { | 29 class AvatarMenuModel : public content::NotificationObserver { |
| 29 public: | 30 public: |
| 30 // Represents an item in the menu. | 31 // Represents an item in the menu. |
| 31 struct Item { | 32 struct Item { |
| 32 Item(size_t model_index, const gfx::Image& icon); | 33 Item(size_t model_index, const gfx::Image& icon); |
| 33 ~Item(); | 34 ~Item(); |
| 34 | 35 |
| 35 // The icon to be displayed next to the item. | 36 // The icon to be displayed next to the item. |
| 36 const gfx::Image& icon; | 37 const gfx::Image icon; |
|
Robert Sesek
2011/11/28 15:30:15
Should this still be const? gfx::Image is effectiv
sail
2011/11/28 15:39:39
Done.
| |
| 37 | 38 |
| 38 // Whether or not the current browser is using this profile. | 39 // Whether or not the current browser is using this profile. |
| 39 bool active; | 40 bool active; |
| 40 | 41 |
| 41 // The name of this profile. | 42 // The name of this profile. |
| 42 string16 name; | 43 string16 name; |
| 43 | 44 |
| 44 // A string representing the sync state of the profile. | 45 // A string representing the sync state of the profile. |
| 45 string16 sync_state; | 46 string16 sync_state; |
| 46 | 47 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 // List of built "menu items." | 107 // List of built "menu items." |
| 107 std::vector<Item*> items_; | 108 std::vector<Item*> items_; |
| 108 | 109 |
| 109 // Listens for notifications from the ProfileInfoCache. | 110 // Listens for notifications from the ProfileInfoCache. |
| 110 content::NotificationRegistrar registrar_; | 111 content::NotificationRegistrar registrar_; |
| 111 | 112 |
| 112 DISALLOW_COPY_AND_ASSIGN(AvatarMenuModel); | 113 DISALLOW_COPY_AND_ASSIGN(AvatarMenuModel); |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_MODEL_H_ | 116 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_MODEL_H_ |
| OLD | NEW |