Chromium Code Reviews| Index: chrome/browser/notifications/platform_notification_service_impl.cc |
| diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc |
| index 3c125e4f60aa17f64a7ecd68622ea802852966f5..7fc4d2121cbb49963c69362ebe98e9a026911900 100644 |
| --- a/chrome/browser/notifications/platform_notification_service_impl.cc |
| +++ b/chrome/browser/notifications/platform_notification_service_impl.cc |
| @@ -101,21 +101,9 @@ void ProfileLoadedCallback( |
| const GURL& origin, |
| int64_t persistent_notification_id, |
| int action_index, |
| - bool incognito, |
| - Profile* profile, |
| - Profile::CreateStatus status) { |
| - if (status == Profile::CREATE_STATUS_CREATED) { |
| - // This is an intermediate state, we will be also called |
| - // again with CREATE_STATUS_INITIALIZED once everything is ready |
| - // so ignore it. |
| + Profile* profile) { |
| + if (!profile) |
|
Peter Beverloo
2016/03/11 17:45:15
We should probably log something if the profile co
Miguel Garcia
2016/03/14 18:29:00
Will add a TODO to add the state and UMA to it and
|
| return; |
| - } |
| - if (status != Profile::CREATE_STATUS_INITIALIZED) { |
| - LOG(WARNING) << "Profile not loaded correctly"; |
| - return; |
| - } |
| - DCHECK(profile); |
| - profile = incognito ? profile->GetOffTheRecordProfile() : profile; |
| switch (operation) { |
| case PlatformNotificationServiceImpl::NOTIFICATION_CLICK: |
| @@ -160,25 +148,10 @@ void PlatformNotificationServiceImpl::ProcessPersistentNotificationOperation( |
| ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| DCHECK(profile_manager); |
| - // ProfileManager does not offer a good interface to load a profile or |
| - // fail. Instead it offers a method to create the profile and simply load it |
| - // if it already exist. We therefore check first that the profile is there |
| - // and fail early otherwise. |
| - const base::FilePath profile_path = |
| - profile_manager->user_data_dir().AppendASCII(profile_id); |
| - |
| - ProfileAttributesEntry* entry = nullptr; |
| - if (!profile_manager->GetProfileAttributesStorage(). |
| - GetProfileAttributesWithPath(profile_path, &entry)) { |
| - LOG(ERROR) << "Loading a path that does not exist"; |
| - return; |
| - } |
| - |
| - profile_manager->CreateProfileAsync( |
| - profile_path, |
| + profile_manager->LoadProfile( |
| + profile_id, incognito, |
| base::Bind(&ProfileLoadedCallback, operation, origin, |
| - persistent_notification_id, action_index, incognito), |
| - base::string16(), std::string(), std::string()); |
| + persistent_notification_id, action_index)); |
| } |
| void PlatformNotificationServiceImpl::OnPersistentNotificationClick( |