summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extensions_service.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 16:46:11 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 16:46:11 +0000
commitce5c4504531cfd32972dfd123f98183c3706951a (patch)
tree679f14d1ea5738a6bedb752a4c61b7f3c50efde1 /chrome/browser/extensions/extensions_service.cc
parentaec92f83d096ca57ab6ce515ae7063b8081b630e (diff)
downloadchromium_src-ce5c4504531cfd32972dfd123f98183c3706951a.zip
chromium_src-ce5c4504531cfd32972dfd123f98183c3706951a.tar.gz
chromium_src-ce5c4504531cfd32972dfd123f98183c3706951a.tar.bz2
PageActions now work across tabs and windows.
The extension system now provides TabId to extensions so it is now possible to activate PageActions in other tabs besides the first in the tab strip. :) BUG=None TEST=None (requires a PageAction extension to test against). Review URL: http://codereview.chromium.org/109046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_service.cc')
-rw-r--r--chrome/browser/extensions/extensions_service.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 338a2ce..0026d18 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -209,6 +209,15 @@ void ExtensionsService::OnExtensionInstalled(Extension* extension,
PageTransition::LINK, true, -1, false, NULL);
}
+Extension* ExtensionsService::GetExtensionByID(std::string id) {
+ for (ExtensionList::const_iterator iter = extensions_.begin();
+ iter != extensions_.end(); ++iter) {
+ if ((*iter)->id() == id)
+ return *iter;
+ }
+ return NULL;
+}
+
ExtensionView* ExtensionsService::CreateView(Extension* extension,
const GURL& url,
Browser* browser) {
@@ -576,7 +585,6 @@ bool ExtensionsServiceBackend::CheckCurrentVersion(
bool ExtensionsServiceBackend::InstallDirSafely(const FilePath& source_dir,
const FilePath& dest_dir) {
-
if (file_util::PathExists(dest_dir)) {
// By the time we get here, it should be safe to assume that this directory
// is not currently in use (it's not the current active version).
@@ -631,7 +639,6 @@ bool ExtensionsServiceBackend::SetCurrentVersion(const FilePath& dest_dir,
if (stream.Open(current_version, flags) != 0)
return false;
if (stream.Write(version.c_str(), version.size(), NULL) < 0) {
-
// Restore the old CurrentVersion.
if (file_util::PathExists(current_version_old)) {
if (!file_util::Move(current_version_old, current_version)) {