| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 LoadAllExtensions(); | 133 LoadAllExtensions(); |
| 134 | 134 |
| 135 // TODO(erikkay) this should probably be deferred to a future point | 135 // TODO(erikkay) this should probably be deferred to a future point |
| 136 // rather than running immediately at startup. | 136 // rather than running immediately at startup. |
| 137 CheckForExternalUpdates(); | 137 CheckForExternalUpdates(); |
| 138 | 138 |
| 139 // TODO(erikkay) this should probably be deferred as well. | 139 // TODO(erikkay) this should probably be deferred as well. |
| 140 GarbageCollectExtensions(); | 140 GarbageCollectExtensions(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 std::vector<ExtensionAction*> ExtensionsService::GetPageActions() const { | |
| 144 std::vector<ExtensionAction*> result; | |
| 145 | |
| 146 // TODO(finnur): Sort the icons in some meaningful way. | |
| 147 for (ExtensionList::const_iterator iter = extensions_.begin(); | |
| 148 iter != extensions_.end(); ++iter) { | |
| 149 if ((*iter)->page_action()) | |
| 150 result.push_back((*iter)->page_action()); | |
| 151 } | |
| 152 | |
| 153 return result; | |
| 154 } | |
| 155 | |
| 156 void ExtensionsService::InstallExtension(const FilePath& extension_path) { | 143 void ExtensionsService::InstallExtension(const FilePath& extension_path) { |
| 157 CrxInstaller::Start(extension_path, install_directory_, Extension::INTERNAL, | 144 CrxInstaller::Start(extension_path, install_directory_, Extension::INTERNAL, |
| 158 "", // no expected id | 145 "", // no expected id |
| 159 false, // don't delete crx when complete | 146 false, // don't delete crx when complete |
| 160 true, // allow privilege increase | 147 true, // allow privilege increase |
| 161 backend_loop_, | 148 backend_loop_, |
| 162 this, | 149 this, |
| 163 NULL); // no client (silent install) | 150 NULL); // no client (silent install) |
| 164 } | 151 } |
| 165 | 152 |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 linked_ptr<ExternalExtensionProvider>(test_provider); | 812 linked_ptr<ExternalExtensionProvider>(test_provider); |
| 826 } | 813 } |
| 827 | 814 |
| 828 void ExtensionsServiceBackend::OnExternalExtensionFound( | 815 void ExtensionsServiceBackend::OnExternalExtensionFound( |
| 829 const std::string& id, const Version* version, const FilePath& path, | 816 const std::string& id, const Version* version, const FilePath& path, |
| 830 Extension::Location location) { | 817 Extension::Location location) { |
| 831 frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(frontend_, | 818 frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(frontend_, |
| 832 &ExtensionsService::OnExternalExtensionFound, id, version->GetString(), | 819 &ExtensionsService::OnExternalExtensionFound, id, version->GetString(), |
| 833 path, location)); | 820 path, location)); |
| 834 } | 821 } |
| OLD | NEW |