| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #include "chrome/browser/search_engines/template_url_service_factory.h" | 64 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 65 #include "chrome/browser/sync/api/sync_change.h" | 65 #include "chrome/browser/sync/api/sync_change.h" |
| 66 #include "chrome/browser/themes/theme_service.h" | 66 #include "chrome/browser/themes/theme_service.h" |
| 67 #include "chrome/browser/themes/theme_service_factory.h" | 67 #include "chrome/browser/themes/theme_service_factory.h" |
| 68 #include "chrome/browser/ui/browser.h" | 68 #include "chrome/browser/ui/browser.h" |
| 69 #include "chrome/browser/ui/browser_list.h" | 69 #include "chrome/browser/ui/browser_list.h" |
| 70 #include "chrome/browser/ui/global_error_service.h" | 70 #include "chrome/browser/ui/global_error_service.h" |
| 71 #include "chrome/browser/ui/global_error_service_factory.h" | 71 #include "chrome/browser/ui/global_error_service_factory.h" |
| 72 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 72 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 73 #include "chrome/browser/ui/webui/favicon_source.h" | 73 #include "chrome/browser/ui/webui/favicon_source.h" |
| 74 #include "chrome/browser/ui/webui/ntp/shown_sections_handler.h" | |
| 75 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" | 74 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" |
| 76 #include "chrome/common/child_process_logging.h" | 75 #include "chrome/common/child_process_logging.h" |
| 77 #include "chrome/common/chrome_notification_types.h" | 76 #include "chrome/common/chrome_notification_types.h" |
| 78 #include "chrome/common/chrome_paths.h" | 77 #include "chrome/common/chrome_paths.h" |
| 79 #include "chrome/common/chrome_switches.h" | 78 #include "chrome/common/chrome_switches.h" |
| 80 #include "chrome/common/extensions/extension.h" | 79 #include "chrome/common/extensions/extension.h" |
| 81 #include "chrome/common/extensions/extension_constants.h" | 80 #include "chrome/common/extensions/extension_constants.h" |
| 82 #include "chrome/common/extensions/extension_error_utils.h" | 81 #include "chrome/common/extensions/extension_error_utils.h" |
| 83 #include "chrome/common/extensions/extension_file_util.h" | 82 #include "chrome/common/extensions/extension_file_util.h" |
| 84 #include "chrome/common/extensions/extension_l10n_util.h" | 83 #include "chrome/common/extensions/extension_l10n_util.h" |
| (...skipping 2539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2624 } | 2623 } |
| 2625 | 2624 |
| 2626 // Do not record the install histograms for upgrades. | 2625 // Do not record the install histograms for upgrades. |
| 2627 if (!GetExtensionByIdInternal(extension->id(), true, true, false)) { | 2626 if (!GetExtensionByIdInternal(extension->id(), true, true, false)) { |
| 2628 UMA_HISTOGRAM_ENUMERATION("Extensions.InstallType", | 2627 UMA_HISTOGRAM_ENUMERATION("Extensions.InstallType", |
| 2629 extension->GetType(), 100); | 2628 extension->GetType(), 100); |
| 2630 RecordPermissionMessagesHistogram( | 2629 RecordPermissionMessagesHistogram( |
| 2631 extension, "Extensions.Permissions_Install"); | 2630 extension, "Extensions.Permissions_Install"); |
| 2632 } | 2631 } |
| 2633 | 2632 |
| 2634 ShownSectionsHandler::OnExtensionInstalled(profile_->GetPrefs(), extension); | |
| 2635 extension_prefs_->OnExtensionInstalled( | 2633 extension_prefs_->OnExtensionInstalled( |
| 2636 extension, | 2634 extension, |
| 2637 initial_enable ? Extension::ENABLED : Extension::DISABLED, | 2635 initial_enable ? Extension::ENABLED : Extension::DISABLED, |
| 2638 from_webstore, | 2636 from_webstore, |
| 2639 page_index); | 2637 page_index); |
| 2640 | 2638 |
| 2641 // Unpacked extensions default to allowing file access, but if that has been | 2639 // Unpacked extensions default to allowing file access, but if that has been |
| 2642 // overridden, don't reset the value. | 2640 // overridden, don't reset the value. |
| 2643 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) && | 2641 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) && |
| 2644 !extension_prefs_->HasAllowFileAccessSetting(id)) { | 2642 !extension_prefs_->HasAllowFileAccessSetting(id)) { |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3060 | 3058 |
| 3061 ExtensionService::NaClModuleInfoList::iterator | 3059 ExtensionService::NaClModuleInfoList::iterator |
| 3062 ExtensionService::FindNaClModule(const GURL& url) { | 3060 ExtensionService::FindNaClModule(const GURL& url) { |
| 3063 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 3061 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 3064 iter != nacl_module_list_.end(); ++iter) { | 3062 iter != nacl_module_list_.end(); ++iter) { |
| 3065 if (iter->url == url) | 3063 if (iter->url == url) |
| 3066 return iter; | 3064 return iter; |
| 3067 } | 3065 } |
| 3068 return nacl_module_list_.end(); | 3066 return nacl_module_list_.end(); |
| 3069 } | 3067 } |
| OLD | NEW |