| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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/extension.h" | 84 #include "chrome/common/extensions/extension.h" |
| 85 #include "chrome/common/extensions/extension_file_util.h" | 85 #include "chrome/common/extensions/extension_file_util.h" |
| 86 #include "chrome/common/extensions/extension_manifest_constants.h" | 86 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 87 #include "chrome/common/extensions/extension_messages.h" | 87 #include "chrome/common/extensions/extension_messages.h" |
| 88 #include "chrome/common/extensions/extension_resource.h" | 88 #include "chrome/common/extensions/extension_resource.h" |
| 89 #include "chrome/common/extensions/feature_switch.h" | 89 #include "chrome/common/extensions/feature_switch.h" |
| 90 #include "chrome/common/extensions/features/feature.h" | 90 #include "chrome/common/extensions/features/feature.h" |
| 91 #include "chrome/common/extensions/manifest.h" | 91 #include "chrome/common/extensions/manifest.h" |
| 92 #include "chrome/common/extensions/manifest_url_handler.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" |
| 94 #include "content/public/browser/browser_thread.h" | 95 #include "content/public/browser/browser_thread.h" |
| 95 #include "content/public/browser/devtools_agent_host.h" | 96 #include "content/public/browser/devtools_agent_host.h" |
| 96 #include "content/public/browser/devtools_manager.h" | 97 #include "content/public/browser/devtools_manager.h" |
| 97 #include "content/public/browser/notification_service.h" | 98 #include "content/public/browser/notification_service.h" |
| 98 #include "content/public/browser/notification_types.h" | 99 #include "content/public/browser/notification_types.h" |
| 99 #include "content/public/browser/plugin_service.h" | 100 #include "content/public/browser/plugin_service.h" |
| 100 #include "content/public/browser/render_process_host.h" | 101 #include "content/public/browser/render_process_host.h" |
| 101 #include "content/public/browser/site_instance.h" | 102 #include "content/public/browser/site_instance.h" |
| (...skipping 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2337 | 2338 |
| 2338 const std::string& id = extension->id(); | 2339 const std::string& id = extension->id(); |
| 2339 bool initial_enable = ShouldEnableOnInstall(extension); | 2340 bool initial_enable = ShouldEnableOnInstall(extension); |
| 2340 const extensions::PendingExtensionInfo* pending_extension_info = NULL; | 2341 const extensions::PendingExtensionInfo* pending_extension_info = NULL; |
| 2341 if ((pending_extension_info = pending_extension_manager()->GetById(id))) { | 2342 if ((pending_extension_info = pending_extension_manager()->GetById(id))) { |
| 2342 if (!pending_extension_info->ShouldAllowInstall(*extension)) { | 2343 if (!pending_extension_info->ShouldAllowInstall(*extension)) { |
| 2343 pending_extension_manager()->Remove(id); | 2344 pending_extension_manager()->Remove(id); |
| 2344 | 2345 |
| 2345 LOG(WARNING) << "ShouldAllowInstall() returned false for " | 2346 LOG(WARNING) << "ShouldAllowInstall() returned false for " |
| 2346 << id << " of type " << extension->GetType() | 2347 << id << " of type " << extension->GetType() |
| 2347 << " and update URL " << extension->update_url().spec() | 2348 << " and update URL " |
| 2349 << extensions::ManifestURL::GetUpdateURL(extension).spec() |
| 2348 << "; not installing"; | 2350 << "; not installing"; |
| 2349 | 2351 |
| 2350 content::NotificationService::current()->Notify( | 2352 content::NotificationService::current()->Notify( |
| 2351 chrome::NOTIFICATION_EXTENSION_INSTALL_NOT_ALLOWED, | 2353 chrome::NOTIFICATION_EXTENSION_INSTALL_NOT_ALLOWED, |
| 2352 content::Source<Profile>(profile_), | 2354 content::Source<Profile>(profile_), |
| 2353 content::Details<const Extension>(extension)); | 2355 content::Details<const Extension>(extension)); |
| 2354 | 2356 |
| 2355 // Delete the extension directory since we're not going to | 2357 // Delete the extension directory since we're not going to |
| 2356 // load it. | 2358 // load it. |
| 2357 if (!GetFileTaskRunner()->PostTask( | 2359 if (!GetFileTaskRunner()->PostTask( |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3116 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); | 3118 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); |
| 3117 DCHECK(extension); | 3119 DCHECK(extension); |
| 3118 if (!extension) | 3120 if (!extension) |
| 3119 continue; | 3121 continue; |
| 3120 blacklisted_extensions_.Insert(extension); | 3122 blacklisted_extensions_.Insert(extension); |
| 3121 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); | 3123 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); |
| 3122 } | 3124 } |
| 3123 | 3125 |
| 3124 IdentifyAlertableExtensions(); | 3126 IdentifyAlertableExtensions(); |
| 3125 } | 3127 } |
| OLD | NEW |