Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Side by Side Diff: chrome/browser/extensions/extensions_service.cc

Issue 332021: Move page actions over to ExtensionAction2 (Closed)
Patch Set: Review feedback Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698