OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/profiles/avatar_menu.h" | 5 #include "chrome/browser/profiles/avatar_menu.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/i18n/case_conversion.h" | 8 #include "base/i18n/case_conversion.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
34 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
35 | 35 |
36 #if defined(ENABLE_SUPERVISED_USERS) | 36 #if defined(ENABLE_SUPERVISED_USERS) |
37 #include "chrome/browser/supervised_user/supervised_user_service.h" | 37 #include "chrome/browser/supervised_user/supervised_user_service.h" |
38 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 38 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
39 #endif | 39 #endif |
40 | 40 |
41 using content::BrowserThread; | 41 using content::BrowserThread; |
42 | 42 |
43 AvatarMenu::AvatarMenu(ProfileInfoInterface* profile_cache, | 43 AvatarMenu::AvatarMenu(ProfileAttributesStorage* /*profile_storage*/, |
lwchkg
2016/02/14 17:07:18
Currently only the interface of AvatarMenu refacto
lwchkg
2016/02/14 17:22:37
I've found another 5 Mac-only files calling this c
| |
44 AvatarMenuObserver* observer, | 44 AvatarMenuObserver* observer, |
45 Browser* browser) | 45 Browser* browser) |
46 : profile_list_(ProfileList::Create(profile_cache)), | 46 : profile_list_(ProfileList::Create( |
47 &g_browser_process->profile_manager()->GetProfileInfoCache())), | |
47 menu_actions_(AvatarMenuActions::Create()), | 48 menu_actions_(AvatarMenuActions::Create()), |
48 #if defined(ENABLE_SUPERVISED_USERS) | 49 #if defined(ENABLE_SUPERVISED_USERS) |
49 supervised_user_observer_(this), | 50 supervised_user_observer_(this), |
50 #endif | 51 #endif |
51 profile_info_(profile_cache), | 52 profile_info_( |
53 &g_browser_process->profile_manager()->GetProfileInfoCache()), | |
52 observer_(observer), | 54 observer_(observer), |
53 browser_(browser) { | 55 browser_(browser) { |
54 DCHECK(profile_info_); | 56 DCHECK(profile_info_); |
55 // Don't DCHECK(browser_) so that unit tests can reuse this ctor. | 57 // Don't DCHECK(browser_) so that unit tests can reuse this ctor. |
56 | 58 |
57 ActiveBrowserChanged(browser_); | 59 ActiveBrowserChanged(browser_); |
58 | 60 |
59 // Register this as an observer of the info cache. | 61 // Register this as an observer of the info cache. |
60 g_browser_process->profile_manager()->GetProfileInfoCache().AddObserver(this); | 62 g_browser_process->profile_manager()->GetProfileInfoCache().AddObserver(this); |
61 | 63 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 if (observer_) | 275 if (observer_) |
274 observer_->OnAvatarMenuChanged(this); | 276 observer_->OnAvatarMenuChanged(this); |
275 } | 277 } |
276 #endif | 278 #endif |
277 | 279 |
278 void AvatarMenu::Update() { | 280 void AvatarMenu::Update() { |
279 RebuildMenu(); | 281 RebuildMenu(); |
280 if (observer_) | 282 if (observer_) |
281 observer_->OnAvatarMenuChanged(this); | 283 observer_->OnAvatarMenuChanged(this); |
282 } | 284 } |
OLD | NEW |