Chromium Code Reviews| Index: chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc |
| diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc |
| index 78512a0c0193e24f2dd0c8aa44b01fcd69cc693d..51c72104b79f6dbbd3d40abd59aea78d6a0384e4 100644 |
| --- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc |
| +++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc |
| @@ -265,19 +265,23 @@ ArcAppListPrefs::~ArcAppListPrefs() { |
| } |
| void ArcAppListPrefs::StartPrefs() { |
| - arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get(); |
| - CHECK(arc_session_manager); |
| - |
| - if (arc_session_manager->profile()) { |
| - // Note: If ArcSessionManager has profile, it should be as same as the one |
| - // this instance has, because ArcAppListPrefsFactory creates an instance |
| - // only if the given Profile meets ARC's requirement. |
| - // Anyway, just in case, check it here. |
| - DCHECK_EQ(profile_, arc_session_manager->profile()); |
| - OnArcPlayStoreEnabledChanged( |
| - arc::IsArcPlayStoreEnabledForProfile(profile_)); |
| + // Don't tie ArcAppListPrefs created with sync test profie in sync integration |
| + // test to ArcSessionManager. |
| + if (!ArcAppListPrefsFactory::IsFactorySetForSyncTest()) { |
|
skym
2017/03/03 19:44:58
How come the other 3 places in this file that call
hidehiko
2017/03/06 05:48:32
Good catch. It should, IMHO.
|
| + arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get(); |
|
skym
2017/03/03 19:44:58
This seems like it would be more clean if you pass
lgcheng
2017/03/03 21:13:01
This is because the life cycle for ArcAppListPrefs
hidehiko
2017/03/06 05:48:32
As for life-time, there is a plan. crbug.com/67282
|
| + CHECK(arc_session_manager); |
|
skym
2017/03/03 19:44:58
Is CHECK really the appropriate macro here? https:
lgcheng
2017/03/03 21:13:01
Well I think hidehiko has his own reason for put t
hidehiko
2017/03/06 05:48:32
Just historical reason, IIUC. So, DCHECK is prefer
|
| + |
| + if (arc_session_manager->profile()) { |
| + // Note: If ArcSessionManager has profile, it should be as same as the one |
| + // this instance has, because ArcAppListPrefsFactory creates an instance |
| + // only if the given Profile meets ARC's requirement. |
| + // Anyway, just in case, check it here. |
| + DCHECK_EQ(profile_, arc_session_manager->profile()); |
| + OnArcPlayStoreEnabledChanged( |
| + arc::IsArcPlayStoreEnabledForProfile(profile_)); |
| + } |
| + arc_session_manager->AddObserver(this); |
| } |
| - arc_session_manager->AddObserver(this); |
| app_instance_holder_->AddObserver(this); |
| if (!app_instance_holder_->has_instance()) |