| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions_service.h" | 5 #include "chrome/browser/extensions/extensions_service.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 break; | 894 break; |
| 895 default: | 895 default: |
| 896 NOTREACHED(); | 896 NOTREACHED(); |
| 897 break; | 897 break; |
| 898 } | 898 } |
| 899 } | 899 } |
| 900 | 900 |
| 901 extension->set_being_upgraded(false); | 901 extension->set_being_upgraded(false); |
| 902 | 902 |
| 903 UpdateActiveExtensionsInCrashReporter(); | 903 UpdateActiveExtensionsInCrashReporter(); |
| 904 |
| 905 if (profile_->GetTemplateURLModel()) |
| 906 profile_->GetTemplateURLModel()->RegisterExtensionKeyword(extension); |
| 904 } | 907 } |
| 905 | 908 |
| 906 void ExtensionsService::UpdateActiveExtensionsInCrashReporter() { | 909 void ExtensionsService::UpdateActiveExtensionsInCrashReporter() { |
| 907 std::set<std::string> extension_ids; | 910 std::set<std::string> extension_ids; |
| 908 for (size_t i = 0; i < extensions_.size(); ++i) { | 911 for (size_t i = 0; i < extensions_.size(); ++i) { |
| 909 if (!extensions_[i]->is_theme()) | 912 if (!extensions_[i]->is_theme()) |
| 910 extension_ids.insert(extensions_[i]->id()); | 913 extension_ids.insert(extensions_[i]->id()); |
| 911 } | 914 } |
| 912 | 915 |
| 913 child_process_logging::SetActiveExtensions(extension_ids); | 916 child_process_logging::SetActiveExtensions(extension_ids); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 NotificationType::THEME_INSTALLED, | 972 NotificationType::THEME_INSTALLED, |
| 970 Source<Profile>(profile_), | 973 Source<Profile>(profile_), |
| 971 Details<Extension>(extension)); | 974 Details<Extension>(extension)); |
| 972 } else { | 975 } else { |
| 973 NotificationService::current()->Notify( | 976 NotificationService::current()->Notify( |
| 974 NotificationType::EXTENSION_INSTALLED, | 977 NotificationType::EXTENSION_INSTALLED, |
| 975 Source<Profile>(profile_), | 978 Source<Profile>(profile_), |
| 976 Details<Extension>(extension)); | 979 Details<Extension>(extension)); |
| 977 } | 980 } |
| 978 | 981 |
| 979 if (profile_->GetTemplateURLModel()) | |
| 980 profile_->GetTemplateURLModel()->RegisterExtensionKeyword(extension); | |
| 981 | |
| 982 // Transfer ownership of |extension| to OnExtensionLoaded. | 982 // Transfer ownership of |extension| to OnExtensionLoaded. |
| 983 OnExtensionLoaded(scoped_extension.release(), allow_privilege_increase); | 983 OnExtensionLoaded(scoped_extension.release(), allow_privilege_increase); |
| 984 } | 984 } |
| 985 | 985 |
| 986 Extension* ExtensionsService::GetExtensionByIdInternal(const std::string& id, | 986 Extension* ExtensionsService::GetExtensionByIdInternal(const std::string& id, |
| 987 bool include_enabled, | 987 bool include_enabled, |
| 988 bool include_disabled) { | 988 bool include_disabled) { |
| 989 std::string lowercase_id = StringToLowerASCII(id); | 989 std::string lowercase_id = StringToLowerASCII(id); |
| 990 if (include_enabled) { | 990 if (include_enabled) { |
| 991 for (ExtensionList::const_iterator iter = extensions_.begin(); | 991 for (ExtensionList::const_iterator iter = extensions_.begin(); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1305 // Finish installing on UI thread. | 1305 // Finish installing on UI thread. |
| 1306 ChromeThread::PostTask( | 1306 ChromeThread::PostTask( |
| 1307 ChromeThread::UI, FROM_HERE, | 1307 ChromeThread::UI, FROM_HERE, |
| 1308 NewRunnableMethod( | 1308 NewRunnableMethod( |
| 1309 frontend_, | 1309 frontend_, |
| 1310 &ExtensionsService::ContinueLoadAllExtensions, | 1310 &ExtensionsService::ContinueLoadAllExtensions, |
| 1311 extensions_to_reload, | 1311 extensions_to_reload, |
| 1312 start_time, | 1312 start_time, |
| 1313 true)); | 1313 true)); |
| 1314 } | 1314 } |
| OLD | NEW |