| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 #include "chrome/browser/prefs/pref_service.h" | 76 #include "chrome/browser/prefs/pref_service.h" |
| 77 #include "chrome/browser/profiles/profile.h" | 77 #include "chrome/browser/profiles/profile.h" |
| 78 #include "chrome/browser/profiles/profile_manager.h" | 78 #include "chrome/browser/profiles/profile_manager.h" |
| 79 #include "chrome/browser/search_engines/template_url_service.h" | 79 #include "chrome/browser/search_engines/template_url_service.h" |
| 80 #include "chrome/browser/search_engines/template_url_service_factory.h" | 80 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 81 #include "chrome/browser/themes/theme_service.h" | 81 #include "chrome/browser/themes/theme_service.h" |
| 82 #include "chrome/browser/themes/theme_service_factory.h" | 82 #include "chrome/browser/themes/theme_service_factory.h" |
| 83 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 83 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 84 #include "chrome/browser/ui/webui/favicon_source.h" | 84 #include "chrome/browser/ui/webui/favicon_source.h" |
| 85 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" | 85 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" |
| 86 #include "chrome/browser/ui/webui/theme_source.h" |
| 86 #include "chrome/common/child_process_logging.h" | 87 #include "chrome/common/child_process_logging.h" |
| 87 #include "chrome/common/chrome_notification_types.h" | 88 #include "chrome/common/chrome_notification_types.h" |
| 88 #include "chrome/common/chrome_paths.h" | 89 #include "chrome/common/chrome_paths.h" |
| 89 #include "chrome/common/chrome_switches.h" | 90 #include "chrome/common/chrome_switches.h" |
| 90 #include "chrome/common/chrome_version_info.h" | 91 #include "chrome/common/chrome_version_info.h" |
| 91 #include "chrome/common/extensions/extension.h" | 92 #include "chrome/common/extensions/extension.h" |
| 92 #include "chrome/common/extensions/extension_error_utils.h" | 93 #include "chrome/common/extensions/extension_error_utils.h" |
| 93 #include "chrome/common/extensions/extension_file_util.h" | 94 #include "chrome/common/extensions/extension_file_util.h" |
| 94 #include "chrome/common/extensions/extension_manifest_constants.h" | 95 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 95 #include "chrome/common/extensions/extension_messages.h" | 96 #include "chrome/common/extensions/extension_messages.h" |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 } | 1013 } |
| 1013 | 1014 |
| 1014 // If the extension has permission to load chrome://favicon/ resources we need | 1015 // If the extension has permission to load chrome://favicon/ resources we need |
| 1015 // to make sure that the FaviconSource is registered with the | 1016 // to make sure that the FaviconSource is registered with the |
| 1016 // ChromeURLDataManager. | 1017 // ChromeURLDataManager. |
| 1017 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { | 1018 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { |
| 1018 FaviconSource* favicon_source = new FaviconSource(profile_, | 1019 FaviconSource* favicon_source = new FaviconSource(profile_, |
| 1019 FaviconSource::FAVICON); | 1020 FaviconSource::FAVICON); |
| 1020 ChromeURLDataManager::AddDataSource(profile_, favicon_source); | 1021 ChromeURLDataManager::AddDataSource(profile_, favicon_source); |
| 1021 } | 1022 } |
| 1023 |
| 1024 #if !defined(OS_ANDROID) |
| 1025 // Same for chrome://theme/ resources. |
| 1026 if (extension->HasHostPermission(GURL(chrome::kChromeUIThemeURL))) { |
| 1027 ThemeSource* theme_source = new ThemeSource(profile_); |
| 1028 ChromeURLDataManager::AddDataSource(profile_, theme_source); |
| 1029 } |
| 1030 #endif |
| 1031 |
| 1022 // Same for chrome://thumb/ resources. | 1032 // Same for chrome://thumb/ resources. |
| 1023 if (extension->HasHostPermission(GURL(chrome::kChromeUIThumbnailURL))) { | 1033 if (extension->HasHostPermission(GURL(chrome::kChromeUIThumbnailURL))) { |
| 1024 ThumbnailSource* thumbnail_source = new ThumbnailSource(profile_); | 1034 ThumbnailSource* thumbnail_source = new ThumbnailSource(profile_); |
| 1025 ChromeURLDataManagerFactory::GetForProfile(profile_)-> | 1035 ChromeURLDataManagerFactory::GetForProfile(profile_)-> |
| 1026 AddDataSource(thumbnail_source); | 1036 AddDataSource(thumbnail_source); |
| 1027 } | 1037 } |
| 1028 | 1038 |
| 1029 // TODO(mpcomplete): This ends up affecting all profiles. See crbug.com/80757. | 1039 // TODO(mpcomplete): This ends up affecting all profiles. See crbug.com/80757. |
| 1030 bool plugins_changed = false; | 1040 bool plugins_changed = false; |
| 1031 for (size_t i = 0; i < extension->plugins().size(); ++i) { | 1041 for (size_t i = 0; i < extension->plugins().size(); ++i) { |
| (...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2624 extensions::ExtensionHost* extension_host) { | 2634 extensions::ExtensionHost* extension_host) { |
| 2625 if (!extension_host) | 2635 if (!extension_host) |
| 2626 return; | 2636 return; |
| 2627 | 2637 |
| 2628 #if !defined(OS_ANDROID) | 2638 #if !defined(OS_ANDROID) |
| 2629 extensions::LaunchPlatformApp(extension_host->profile(), | 2639 extensions::LaunchPlatformApp(extension_host->profile(), |
| 2630 extension_host->extension(), | 2640 extension_host->extension(), |
| 2631 NULL, FilePath()); | 2641 NULL, FilePath()); |
| 2632 #endif | 2642 #endif |
| 2633 } | 2643 } |
| OLD | NEW |