OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PROFILE_LIST_DESKTOP_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_LIST_DESKTOP_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_LIST_DESKTOP_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_LIST_DESKTOP_H_ |
7 | 7 |
8 #include "chrome/browser/profiles/profile_list.h" | 8 #include "chrome/browser/profiles/profile_list.h" |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 class Browser; | 12 class Browser; |
13 class ProfileInfoInterface; | 13 class ProfileInfoInterface; |
14 | 14 |
15 // This model represents the profiles added to desktop Chrome (as opposed to | 15 // This model represents the profiles added to desktop Chrome (as opposed to |
16 // Chrome OS). Profiles marked not to appear in the list will be omitted | 16 // Chrome OS). Profiles marked not to appear in the list will be omitted |
17 // throughout. | 17 // throughout. |
18 class ProfileListDesktop : public ProfileList { | 18 class ProfileListDesktop : public ProfileList { |
19 public: | 19 public: |
20 explicit ProfileListDesktop(ProfileInfoInterface* profile_cache); | 20 explicit ProfileListDesktop(ProfileInfoInterface* profile_cache); |
21 virtual ~ProfileListDesktop(); | 21 virtual ~ProfileListDesktop(); |
22 | 22 |
23 // ProfileList overrides: | 23 // ProfileList overrides: |
24 virtual size_t GetNumberOfItems() const OVERRIDE; | 24 virtual size_t GetNumberOfItems() const override; |
25 virtual const AvatarMenu::Item& GetItemAt(size_t index) const OVERRIDE; | 25 virtual const AvatarMenu::Item& GetItemAt(size_t index) const override; |
26 virtual void RebuildMenu() OVERRIDE; | 26 virtual void RebuildMenu() override; |
27 // Returns the menu index of the profile at |index| in the ProfileInfoCache. | 27 // Returns the menu index of the profile at |index| in the ProfileInfoCache. |
28 // The profile index must exist, and it may not be marked as omitted from the | 28 // The profile index must exist, and it may not be marked as omitted from the |
29 // menu. | 29 // menu. |
30 virtual size_t MenuIndexFromProfileIndex(size_t index) OVERRIDE; | 30 virtual size_t MenuIndexFromProfileIndex(size_t index) override; |
31 virtual void ActiveProfilePathChanged(base::FilePath& path) OVERRIDE; | 31 virtual void ActiveProfilePathChanged(base::FilePath& path) override; |
32 | 32 |
33 private: | 33 private: |
34 void ClearMenu(); | 34 void ClearMenu(); |
35 | 35 |
36 // The cache that provides the profile information. Weak. | 36 // The cache that provides the profile information. Weak. |
37 ProfileInfoInterface* profile_info_; | 37 ProfileInfoInterface* profile_info_; |
38 | 38 |
39 // The path of the currently active profile. | 39 // The path of the currently active profile. |
40 base::FilePath active_profile_path_; | 40 base::FilePath active_profile_path_; |
41 | 41 |
42 // List of built "menu items." | 42 // List of built "menu items." |
43 std::vector<AvatarMenu::Item*> items_; | 43 std::vector<AvatarMenu::Item*> items_; |
44 | 44 |
45 // The number of profiles that were omitted from the list when it was built. | 45 // The number of profiles that were omitted from the list when it was built. |
46 size_t omitted_item_count_; | 46 size_t omitted_item_count_; |
47 | 47 |
48 DISALLOW_COPY_AND_ASSIGN(ProfileListDesktop); | 48 DISALLOW_COPY_AND_ASSIGN(ProfileListDesktop); |
49 }; | 49 }; |
50 | 50 |
51 #endif // CHROME_BROWSER_PROFILES_PROFILE_LIST_DESKTOP_H_ | 51 #endif // CHROME_BROWSER_PROFILES_PROFILE_LIST_DESKTOP_H_ |
OLD | NEW |