| 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 <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "chrome/browser/themes/theme_service_factory.h" | 74 #include "chrome/browser/themes/theme_service_factory.h" |
| 75 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 75 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 76 #include "chrome/browser/ui/webui/favicon_source.h" | 76 #include "chrome/browser/ui/webui/favicon_source.h" |
| 77 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" | 77 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" |
| 78 #include "chrome/browser/ui/webui/theme_source.h" | 78 #include "chrome/browser/ui/webui/theme_source.h" |
| 79 #include "chrome/common/child_process_logging.h" | 79 #include "chrome/common/child_process_logging.h" |
| 80 #include "chrome/common/chrome_notification_types.h" | 80 #include "chrome/common/chrome_notification_types.h" |
| 81 #include "chrome/common/chrome_paths.h" | 81 #include "chrome/common/chrome_paths.h" |
| 82 #include "chrome/common/chrome_switches.h" | 82 #include "chrome/common/chrome_switches.h" |
| 83 #include "chrome/common/chrome_version_info.h" | 83 #include "chrome/common/chrome_version_info.h" |
| 84 #include "chrome/common/extensions/api/extension_urls/extension_urls_handler.h" |
| 84 #include "chrome/common/extensions/extension.h" | 85 #include "chrome/common/extensions/extension.h" |
| 85 #include "chrome/common/extensions/extension_file_util.h" | 86 #include "chrome/common/extensions/extension_file_util.h" |
| 86 #include "chrome/common/extensions/extension_manifest_constants.h" | 87 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 87 #include "chrome/common/extensions/extension_messages.h" | 88 #include "chrome/common/extensions/extension_messages.h" |
| 88 #include "chrome/common/extensions/extension_resource.h" | 89 #include "chrome/common/extensions/extension_resource.h" |
| 89 #include "chrome/common/extensions/feature_switch.h" | 90 #include "chrome/common/extensions/feature_switch.h" |
| 90 #include "chrome/common/extensions/features/feature.h" | 91 #include "chrome/common/extensions/features/feature.h" |
| 91 #include "chrome/common/extensions/manifest.h" | 92 #include "chrome/common/extensions/manifest.h" |
| 92 #include "chrome/common/pref_names.h" | 93 #include "chrome/common/pref_names.h" |
| 93 #include "chrome/common/url_constants.h" | 94 #include "chrome/common/url_constants.h" |
| (...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2345 | 2346 |
| 2346 const std::string& id = extension->id(); | 2347 const std::string& id = extension->id(); |
| 2347 bool initial_enable = ShouldEnableOnInstall(extension); | 2348 bool initial_enable = ShouldEnableOnInstall(extension); |
| 2348 const extensions::PendingExtensionInfo* pending_extension_info = NULL; | 2349 const extensions::PendingExtensionInfo* pending_extension_info = NULL; |
| 2349 if ((pending_extension_info = pending_extension_manager()->GetById(id))) { | 2350 if ((pending_extension_info = pending_extension_manager()->GetById(id))) { |
| 2350 if (!pending_extension_info->ShouldAllowInstall(*extension)) { | 2351 if (!pending_extension_info->ShouldAllowInstall(*extension)) { |
| 2351 pending_extension_manager()->Remove(id); | 2352 pending_extension_manager()->Remove(id); |
| 2352 | 2353 |
| 2353 LOG(WARNING) << "ShouldAllowInstall() returned false for " | 2354 LOG(WARNING) << "ShouldAllowInstall() returned false for " |
| 2354 << id << " of type " << extension->GetType() | 2355 << id << " of type " << extension->GetType() |
| 2355 << " and update URL " << extension->update_url().spec() | 2356 << " and update URL " |
| 2357 << extensions::ExtensionURL::GetUpdateURL(extension).spec() |
| 2356 << "; not installing"; | 2358 << "; not installing"; |
| 2357 | 2359 |
| 2358 content::NotificationService::current()->Notify( | 2360 content::NotificationService::current()->Notify( |
| 2359 chrome::NOTIFICATION_EXTENSION_INSTALL_NOT_ALLOWED, | 2361 chrome::NOTIFICATION_EXTENSION_INSTALL_NOT_ALLOWED, |
| 2360 content::Source<Profile>(profile_), | 2362 content::Source<Profile>(profile_), |
| 2361 content::Details<const Extension>(extension)); | 2363 content::Details<const Extension>(extension)); |
| 2362 | 2364 |
| 2363 // Delete the extension directory since we're not going to | 2365 // Delete the extension directory since we're not going to |
| 2364 // load it. | 2366 // load it. |
| 2365 if (!GetFileTaskRunner()->PostTask( | 2367 if (!GetFileTaskRunner()->PostTask( |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3122 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); | 3124 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); |
| 3123 DCHECK(extension); | 3125 DCHECK(extension); |
| 3124 if (!extension) | 3126 if (!extension) |
| 3125 continue; | 3127 continue; |
| 3126 blacklisted_extensions_.Insert(extension); | 3128 blacklisted_extensions_.Insert(extension); |
| 3127 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); | 3129 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); |
| 3128 } | 3130 } |
| 3129 | 3131 |
| 3130 IdentifyAlertableExtensions(); | 3132 IdentifyAlertableExtensions(); |
| 3131 } | 3133 } |
| OLD | NEW |