| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 LoadAllExtensions(); | 137 LoadAllExtensions(); |
| 138 | 138 |
| 139 // TODO(erikkay) this should probably be deferred to a future point | 139 // TODO(erikkay) this should probably be deferred to a future point |
| 140 // rather than running immediately at startup. | 140 // rather than running immediately at startup. |
| 141 CheckForExternalUpdates(); | 141 CheckForExternalUpdates(); |
| 142 | 142 |
| 143 // TODO(erikkay) this should probably be deferred as well. | 143 // TODO(erikkay) this should probably be deferred as well. |
| 144 GarbageCollectExtensions(); | 144 GarbageCollectExtensions(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 std::vector<PageAction*> ExtensionsService::GetPageActions() const { |
| 148 std::vector<PageAction*> result; |
| 149 |
| 150 // TODO(finnur): Sort the page icons in some meaningful way. |
| 151 for (ExtensionList::const_iterator iter = extensions_.begin(); |
| 152 iter != extensions_.end(); ++iter) { |
| 153 const PageActionMap& page_actions = (*iter)->page_actions(); |
| 154 for (PageActionMap::const_iterator i(page_actions.begin()); |
| 155 i != page_actions.end(); ++i) { |
| 156 result.push_back(i->second); |
| 157 } |
| 158 } |
| 159 |
| 160 return result; |
| 161 } |
| 162 |
| 147 void ExtensionsService::InstallExtension(const FilePath& extension_path) { | 163 void ExtensionsService::InstallExtension(const FilePath& extension_path) { |
| 148 CrxInstaller::Start(extension_path, install_directory_, Extension::INTERNAL, | 164 CrxInstaller::Start(extension_path, install_directory_, Extension::INTERNAL, |
| 149 "", // no expected id | 165 "", // no expected id |
| 150 false, // don't delete crx when complete | 166 false, // don't delete crx when complete |
| 151 true, // allow privilege increase | 167 true, // allow privilege increase |
| 152 backend_loop_, | 168 backend_loop_, |
| 153 this, | 169 this, |
| 154 NULL); // no client (silent install) | 170 NULL); // no client (silent install) |
| 155 } | 171 } |
| 156 | 172 |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 linked_ptr<ExternalExtensionProvider>(test_provider); | 752 linked_ptr<ExternalExtensionProvider>(test_provider); |
| 737 } | 753 } |
| 738 | 754 |
| 739 void ExtensionsServiceBackend::OnExternalExtensionFound( | 755 void ExtensionsServiceBackend::OnExternalExtensionFound( |
| 740 const std::string& id, const Version* version, const FilePath& path, | 756 const std::string& id, const Version* version, const FilePath& path, |
| 741 Extension::Location location) { | 757 Extension::Location location) { |
| 742 frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(frontend_, | 758 frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(frontend_, |
| 743 &ExtensionsService::OnExternalExtensionFound, id, version->GetString(), | 759 &ExtensionsService::OnExternalExtensionFound, id, version->GetString(), |
| 744 path, location)); | 760 path, location)); |
| 745 } | 761 } |
| OLD | NEW |