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

Unified Diff: chrome/browser/extensions/action_box_controller.cc

Issue 10388160: Only return the visible page actions from PageActionController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: actually fix Created 8 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/action_box_controller.cc
diff --git a/chrome/browser/extensions/action_box_controller.cc b/chrome/browser/extensions/action_box_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..13a8f172b6f0f86c48e3e4b7cdadd3f7f0d7fc42
--- /dev/null
+++ b/chrome/browser/extensions/action_box_controller.cc
@@ -0,0 +1,23 @@
+// 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.
+
+#include "chrome/browser/extensions/action_box_controller.h"
+
+#include <algorithm>
+
+namespace extensions {
+
+// static
+void ActionBoxController::AddMissingActions(
+ const std::set<ExtensionAction*>& actions,
+ std::vector<ExtensionAction*>* out) {
+ for (std::set<ExtensionAction*>::const_iterator it = actions.begin();
+ it != actions.end(); ++it) {
+ ExtensionAction* action = (*it);
+ if (!std::count(out->begin(), out->end(), action))
+ out->push_back(action);
+ }
+}
+
+} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/action_box_controller.h ('k') | chrome/browser/extensions/execute_code_in_tab_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698