summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_set.cc
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 07:43:01 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 07:43:01 +0000
commit7f4308d5da55597a0c2c74a5749ae6439082b18a (patch)
tree0b7ea28f453d56e3e1e6fa4eb16b550b0b1d3af6 /chrome/common/extensions/extension_set.cc
parent257b2c5198a848075c7f62f2619c027e76873b2d (diff)
downloadchromium_src-7f4308d5da55597a0c2c74a5749ae6439082b18a.zip
chromium_src-7f4308d5da55597a0c2c74a5749ae6439082b18a.tar.gz
chromium_src-7f4308d5da55597a0c2c74a5749ae6439082b18a.tar.bz2
[NTP4] Add ExtensionSet::AddAll and ExtensionService::GetAllInstalledExtensions.
R=aa@chromium.org TBR=estade@chromium.org TEST=ExtensionsSetTest.ExtensionSet passes and nothing breaks. BUG=97762 Review URL: http://codereview.chromium.org/9134003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118077 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_set.cc')
-rw-r--r--chrome/common/extensions/extension_set.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/common/extensions/extension_set.cc b/chrome/common/extensions/extension_set.cc
index d6d18f7..f5aee9f 100644
--- a/chrome/common/extensions/extension_set.cc
+++ b/chrome/common/extensions/extension_set.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -41,6 +41,15 @@ void ExtensionSet::Insert(const scoped_refptr<const Extension>& extension) {
extensions_[extension->id()] = extension;
}
+bool ExtensionSet::InsertAll(const ExtensionSet& extensions) {
+ size_t before = size();
+ for (ExtensionSet::const_iterator iter = extensions.begin();
+ iter != extensions.end(); ++iter) {
+ Insert(*iter);
+ }
+ return size() != before;
+}
+
void ExtensionSet::Remove(const std::string& id) {
extensions_.erase(id);
}