Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/notifications/message_center_settings_controller.h" | 5 #include "chrome/browser/notifications/message_center_settings_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/i18n/string_compare.h" | 9 #include "base/i18n/string_compare.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 | 68 |
| 69 void MessageCenterSettingsController::RemoveObserver( | 69 void MessageCenterSettingsController::RemoveObserver( |
| 70 message_center::NotifierSettingsObserver* observer) { | 70 message_center::NotifierSettingsObserver* observer) { |
| 71 observers_.RemoveObserver(observer); | 71 observers_.RemoveObserver(observer); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void MessageCenterSettingsController::GetNotifierList( | 74 void MessageCenterSettingsController::GetNotifierList( |
| 75 std::vector<Notifier*>* notifiers) { | 75 std::vector<Notifier*>* notifiers) { |
| 76 DCHECK(notifiers); | 76 DCHECK(notifiers); |
| 77 // TODO(mukai): Fix this for multi-profile. | 77 // TODO(mukai): Fix this for multi-profile. |
| 78 Profile* profile = ProfileManager::GetDefaultProfile(); | 78 // Temporarily use the last used profile to prevent chrome from crashing when |
| 79 // the default profile is not loaded. | |
|
dewittj
2013/06/28 01:13:18
I suspect you should actually use GetLastUsedProfi
sidharthms
2013/07/02 18:09:51
Done.
| |
| 80 Profile* profile = ProfileManager::GetLastUsedProfile(); | |
| 79 DesktopNotificationService* notification_service = | 81 DesktopNotificationService* notification_service = |
| 80 DesktopNotificationServiceFactory::GetForProfile(profile); | 82 DesktopNotificationServiceFactory::GetForProfile(profile); |
| 81 | 83 |
| 82 UErrorCode error; | 84 UErrorCode error; |
| 83 scoped_ptr<icu::Collator> collator(icu::Collator::createInstance(error)); | 85 scoped_ptr<icu::Collator> collator(icu::Collator::createInstance(error)); |
| 84 scoped_ptr<NotifierComparator> comparator; | 86 scoped_ptr<NotifierComparator> comparator; |
| 85 if (!U_FAILURE(error)) | 87 if (!U_FAILURE(error)) |
| 86 comparator.reset(new NotifierComparator(collator.get())); | 88 comparator.reset(new NotifierComparator(collator.get())); |
| 87 | 89 |
| 88 ExtensionService* extension_service = profile->GetExtensionService(); | 90 ExtensionService* extension_service = profile->GetExtensionService(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 UpdateFavicon(url, favicon_result.image)); | 235 UpdateFavicon(url, favicon_result.image)); |
| 234 } | 236 } |
| 235 | 237 |
| 236 | 238 |
| 237 void MessageCenterSettingsController::SetAppImage(const std::string& id, | 239 void MessageCenterSettingsController::SetAppImage(const std::string& id, |
| 238 const gfx::ImageSkia& image) { | 240 const gfx::ImageSkia& image) { |
| 239 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver, | 241 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver, |
| 240 observers_, | 242 observers_, |
| 241 UpdateIconImage(id, gfx::Image(image))); | 243 UpdateIconImage(id, gfx::Image(image))); |
| 242 } | 244 } |
| OLD | NEW |