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; |
+} |