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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/string_compare.h" | 10 #include "base/i18n/string_compare.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 DesktopNotificationService* notification_service = | 185 DesktopNotificationService* notification_service = |
186 DesktopNotificationServiceFactory::GetForProfile(profile); | 186 DesktopNotificationServiceFactory::GetForProfile(profile); |
187 | 187 |
188 UErrorCode error; | 188 UErrorCode error; |
189 scoped_ptr<icu::Collator> collator(icu::Collator::createInstance(error)); | 189 scoped_ptr<icu::Collator> collator(icu::Collator::createInstance(error)); |
190 scoped_ptr<NotifierComparator> comparator; | 190 scoped_ptr<NotifierComparator> comparator; |
191 if (!U_FAILURE(error)) | 191 if (!U_FAILURE(error)) |
192 comparator.reset(new NotifierComparator(collator.get())); | 192 comparator.reset(new NotifierComparator(collator.get())); |
193 | 193 |
194 ExtensionService* extension_service = profile->GetExtensionService(); | 194 ExtensionService* extension_service = profile->GetExtensionService(); |
195 const ExtensionSet* extension_set = extension_service->extensions(); | 195 const extensions::ExtensionSet* extension_set = |
| 196 extension_service->extensions(); |
196 // The extension icon size has to be 32x32 at least to load bigger icons if | 197 // The extension icon size has to be 32x32 at least to load bigger icons if |
197 // the icon doesn't exist for the specified size, and in that case it falls | 198 // the icon doesn't exist for the specified size, and in that case it falls |
198 // back to the default icon. The fetched icon will be resized in the settings | 199 // back to the default icon. The fetched icon will be resized in the settings |
199 // dialog. See chrome/browser/extensions/extension_icon_image.cc and | 200 // dialog. See chrome/browser/extensions/extension_icon_image.cc and |
200 // crbug.com/222931 | 201 // crbug.com/222931 |
201 app_icon_loader_.reset(new extensions::AppIconLoaderImpl( | 202 app_icon_loader_.reset(new extensions::AppIconLoaderImpl( |
202 profile, extension_misc::EXTENSION_ICON_SMALL, this)); | 203 profile, extension_misc::EXTENSION_ICON_SMALL, this)); |
203 for (ExtensionSet::const_iterator iter = extension_set->begin(); | 204 for (extensions::ExtensionSet::const_iterator iter = extension_set->begin(); |
204 iter != extension_set->end(); | 205 iter != extension_set->end(); |
205 ++iter) { | 206 ++iter) { |
206 const extensions::Extension* extension = iter->get(); | 207 const extensions::Extension* extension = iter->get(); |
207 if (!extension->HasAPIPermission( | 208 if (!extension->HasAPIPermission( |
208 extensions::APIPermission::kNotification)) { | 209 extensions::APIPermission::kNotification)) { |
209 continue; | 210 continue; |
210 } | 211 } |
211 | 212 |
212 NotifierId notifier_id(NotifierId::APPLICATION, extension->id()); | 213 NotifierId notifier_id(NotifierId::APPLICATION, extension->id()); |
213 notifiers->push_back(new Notifier( | 214 notifiers->push_back(new Notifier( |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 | 472 |
472 // In ChromeOS, the login screen first creates a dummy profile which is not | 473 // In ChromeOS, the login screen first creates a dummy profile which is not |
473 // actually used, and then the real profile for the user is created when | 474 // actually used, and then the real profile for the user is created when |
474 // login (or turns into kiosk mode). This profile should be skipped. | 475 // login (or turns into kiosk mode). This profile should be skipped. |
475 if (chromeos::ProfileHelper::IsSigninProfile(group->profile())) | 476 if (chromeos::ProfileHelper::IsSigninProfile(group->profile())) |
476 continue; | 477 continue; |
477 #endif | 478 #endif |
478 notifier_groups_.push_back(group.release()); | 479 notifier_groups_.push_back(group.release()); |
479 } | 480 } |
480 } | 481 } |
OLD | NEW |