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" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void SwitchToProfile(size_t index); | 62 void SwitchToProfile(size_t index); |
63 // Opens the profile settings in response to clicking the edit button next to | 63 // Opens the profile settings in response to clicking the edit button next to |
64 // an item. | 64 // an item. |
65 void EditProfile(size_t index); | 65 void EditProfile(size_t index); |
66 // Creates a new profile. | 66 // Creates a new profile. |
67 void AddNewProfile(); | 67 void AddNewProfile(); |
68 | 68 |
69 // Gets the number of profiles. | 69 // Gets the number of profiles. |
70 size_t GetNumberOfItems(); | 70 size_t GetNumberOfItems(); |
71 | 71 |
| 72 // Returns the index of the active profile. |
| 73 size_t GetActiveProfileIndex(); |
| 74 |
72 // Gets the an Item at a specified index. | 75 // Gets the an Item at a specified index. |
73 const Item& GetItemAt(size_t index); | 76 const Item& GetItemAt(size_t index); |
74 | 77 |
75 // This model is also used for the always-present Mac system menubar. As the | 78 // This model is also used for the always-present Mac system menubar. As the |
76 // last active browser changes, the model needs to update accordingly. | 79 // last active browser changes, the model needs to update accordingly. |
77 void set_browser(Browser* browser) { browser_ = browser; } | 80 void set_browser(Browser* browser) { browser_ = browser; } |
78 | 81 |
79 // content::NotificationObserver: | 82 // content::NotificationObserver: |
80 virtual void Observe(int type, | 83 virtual void Observe(int type, |
81 const content::NotificationSource& source, | 84 const content::NotificationSource& source, |
(...skipping 21 matching lines...) Expand all Loading... |
103 // List of built "menu items." | 106 // List of built "menu items." |
104 std::vector<Item*> items_; | 107 std::vector<Item*> items_; |
105 | 108 |
106 // Listens for notifications from the ProfileInfoCache. | 109 // Listens for notifications from the ProfileInfoCache. |
107 content::NotificationRegistrar registrar_; | 110 content::NotificationRegistrar registrar_; |
108 | 111 |
109 DISALLOW_COPY_AND_ASSIGN(AvatarMenuModel); | 112 DISALLOW_COPY_AND_ASSIGN(AvatarMenuModel); |
110 }; | 113 }; |
111 | 114 |
112 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_MODEL_H_ | 115 #endif // CHROME_BROWSER_PROFILES_AVATAR_MENU_MODEL_H_ |
OLD | NEW |