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

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

Issue 10175008: Improving the process model extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improved task manager sample and minor cleanup. Created 8 years, 8 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/extension_tab_util.cc
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index 19befff70be7952468f9eb0d0ddfb10471d662a1..2c2183deb3a0ee55ac3fe2d54bc5ecc525d8787b 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -223,3 +223,25 @@ bool ExtensionTabUtil::IsCrashURL(const GURL& url) {
(fixed_url.host() == chrome::kChromeUIBrowserCrashHost ||
fixed_url.host() == chrome::kChromeUICrashHost));
}
+
+bool ExtensionTabUtil::ReadOneOrMoreIntegers(base::Value* value,
+ std::vector<int>* result) {
+ if (value->IsType(Value::TYPE_INTEGER)) {
+ int tab_id = -1;
+ if (!value->GetAsInteger(&tab_id))
+ return false;
+ result->push_back(tab_id);
+ return true;
+
+ } else if (value->IsType(Value::TYPE_LIST)) {
+ ListValue* tabs = static_cast<ListValue*>(value);
+ for (size_t i = 0; i < tabs->GetSize(); ++i) {
+ int tab_id = -1;
+ if (!tabs->GetInteger(i, &tab_id))
+ return false;
+ result->push_back(tab_id);
+ }
+ return true;
+ }
+ return false;
+}

Powered by Google App Engine
This is Rietveld 408576698