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 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/profiles/profile_manager.h" | 28 #include "chrome/browser/profiles/profile_manager.h" |
29 #include "chrome/common/extensions/api/notifications.h" | 29 #include "chrome/common/extensions/api/notifications.h" |
30 #include "chrome/common/extensions/extension_constants.h" | 30 #include "chrome/common/extensions/extension_constants.h" |
31 #include "components/favicon_base/favicon_types.h" | 31 #include "components/favicon_base/favicon_types.h" |
32 #include "content/public/browser/notification_service.h" | 32 #include "content/public/browser/notification_service.h" |
33 #include "content/public/browser/notification_source.h" | 33 #include "content/public/browser/notification_source.h" |
34 #include "extensions/browser/event_router.h" | 34 #include "extensions/browser/event_router.h" |
35 #include "extensions/browser/extension_system.h" | 35 #include "extensions/browser/extension_system.h" |
36 #include "extensions/browser/extension_util.h" | 36 #include "extensions/browser/extension_util.h" |
37 #include "extensions/common/constants.h" | 37 #include "extensions/common/constants.h" |
| 38 #include "extensions/common/extension.h" |
| 39 #include "extensions/common/permissions/permissions_data.h" |
38 #include "grit/theme_resources.h" | 40 #include "grit/theme_resources.h" |
39 #include "grit/ui_strings.h" | 41 #include "grit/ui_strings.h" |
40 #include "ui/base/l10n/l10n_util.h" | 42 #include "ui/base/l10n/l10n_util.h" |
41 #include "ui/base/resource/resource_bundle.h" | 43 #include "ui/base/resource/resource_bundle.h" |
42 #include "ui/gfx/image/image.h" | 44 #include "ui/gfx/image/image.h" |
43 #include "ui/message_center/message_center_style.h" | 45 #include "ui/message_center/message_center_style.h" |
44 | 46 |
45 #if defined(OS_CHROMEOS) | 47 #if defined(OS_CHROMEOS) |
46 #include "ash/system/system_notifier.h" | 48 #include "ash/system/system_notifier.h" |
47 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 49 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // the icon doesn't exist for the specified size, and in that case it falls | 222 // the icon doesn't exist for the specified size, and in that case it falls |
221 // back to the default icon. The fetched icon will be resized in the settings | 223 // back to the default icon. The fetched icon will be resized in the settings |
222 // dialog. See chrome/browser/extensions/extension_icon_image.cc and | 224 // dialog. See chrome/browser/extensions/extension_icon_image.cc and |
223 // crbug.com/222931 | 225 // crbug.com/222931 |
224 app_icon_loader_.reset(new extensions::AppIconLoaderImpl( | 226 app_icon_loader_.reset(new extensions::AppIconLoaderImpl( |
225 profile, extension_misc::EXTENSION_ICON_SMALL, this)); | 227 profile, extension_misc::EXTENSION_ICON_SMALL, this)); |
226 for (extensions::ExtensionSet::const_iterator iter = extension_set->begin(); | 228 for (extensions::ExtensionSet::const_iterator iter = extension_set->begin(); |
227 iter != extension_set->end(); | 229 iter != extension_set->end(); |
228 ++iter) { | 230 ++iter) { |
229 const extensions::Extension* extension = iter->get(); | 231 const extensions::Extension* extension = iter->get(); |
230 if (!extension->HasAPIPermission( | 232 if (!extension->permissions_data()->HasAPIPermission( |
231 extensions::APIPermission::kNotification)) { | 233 extensions::APIPermission::kNotification)) { |
232 continue; | 234 continue; |
233 } | 235 } |
234 | 236 |
235 // Exclude cached ephemeral apps that are not currently running. | 237 // Exclude cached ephemeral apps that are not currently running. |
236 if (extensions::util::IsEphemeralApp(extension->id(), profile) && | 238 if (extensions::util::IsEphemeralApp(extension->id(), profile) && |
237 extensions::util::IsExtensionIdle(extension->id(), profile)) { | 239 extensions::util::IsExtensionIdle(extension->id(), profile)) { |
238 continue; | 240 continue; |
239 } | 241 } |
240 | 242 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 // creating a primary profile, and causes an infinite loop. | 545 // creating a primary profile, and causes an infinite loop. |
544 // Thus, it would be better to delay creating group for guest login. | 546 // Thus, it would be better to delay creating group for guest login. |
545 base::MessageLoopProxy::current()->PostTask( | 547 base::MessageLoopProxy::current()->PostTask( |
546 FROM_HERE, | 548 FROM_HERE, |
547 base::Bind( | 549 base::Bind( |
548 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, | 550 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, |
549 weak_factory_.GetWeakPtr())); | 551 weak_factory_.GetWeakPtr())); |
550 } | 552 } |
551 #endif | 553 #endif |
552 } | 554 } |
OLD | NEW |