| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2048 } | 2048 } |
| 2049 } else { | 2049 } else { |
| 2050 // We explicitly want to re-enable an uninstalled external | 2050 // We explicitly want to re-enable an uninstalled external |
| 2051 // extension; if we're here, that means the user is manually | 2051 // extension; if we're here, that means the user is manually |
| 2052 // installing the extension. | 2052 // installing the extension. |
| 2053 if (IsExternalExtensionUninstalled(id)) { | 2053 if (IsExternalExtensionUninstalled(id)) { |
| 2054 initial_enable = true; | 2054 initial_enable = true; |
| 2055 } | 2055 } |
| 2056 } | 2056 } |
| 2057 | 2057 |
| 2058 UMA_HISTOGRAM_ENUMERATION("Extensions.InstallType", | 2058 // Do not record the install histograms for upgrades. |
| 2059 extension->GetType(), 100); | 2059 if (!GetExtensionByIdInternal(extension->id(), true, true, false)) { |
| 2060 RecordPermissionMessagesHistogram( | 2060 UMA_HISTOGRAM_ENUMERATION("Extensions.InstallType", |
| 2061 extension, "Extensions.Permissions_Install"); | 2061 extension->GetType(), 100); |
| 2062 RecordPermissionMessagesHistogram( |
| 2063 extension, "Extensions.Permissions_Install"); |
| 2064 } |
| 2065 |
| 2062 ShownSectionsHandler::OnExtensionInstalled(profile_->GetPrefs(), extension); | 2066 ShownSectionsHandler::OnExtensionInstalled(profile_->GetPrefs(), extension); |
| 2063 extension_prefs_->OnExtensionInstalled( | 2067 extension_prefs_->OnExtensionInstalled( |
| 2064 extension, initial_enable ? Extension::ENABLED : Extension::DISABLED); | 2068 extension, initial_enable ? Extension::ENABLED : Extension::DISABLED); |
| 2065 | 2069 |
| 2066 // Unpacked extensions default to allowing file access, but if that has been | 2070 // Unpacked extensions default to allowing file access, but if that has been |
| 2067 // overridden, don't reset the value. | 2071 // overridden, don't reset the value. |
| 2068 if (Extension::ShouldAlwaysAllowFileAccess(Extension::LOAD) && | 2072 if (Extension::ShouldAlwaysAllowFileAccess(Extension::LOAD) && |
| 2069 !extension_prefs_->HasAllowFileAccessSetting(id)) { | 2073 !extension_prefs_->HasAllowFileAccessSetting(id)) { |
| 2070 extension_prefs_->SetAllowFileAccess(id, true); | 2074 extension_prefs_->SetAllowFileAccess(id, true); |
| 2071 } | 2075 } |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2416 | 2420 |
| 2417 ExtensionService::NaClModuleInfoList::iterator | 2421 ExtensionService::NaClModuleInfoList::iterator |
| 2418 ExtensionService::FindNaClModule(const GURL& url) { | 2422 ExtensionService::FindNaClModule(const GURL& url) { |
| 2419 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2423 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 2420 iter != nacl_module_list_.end(); ++iter) { | 2424 iter != nacl_module_list_.end(); ++iter) { |
| 2421 if (iter->url == url) | 2425 if (iter->url == url) |
| 2422 return iter; | 2426 return iter; |
| 2423 } | 2427 } |
| 2424 return nacl_module_list_.end(); | 2428 return nacl_module_list_.end(); |
| 2425 } | 2429 } |
| OLD | NEW |