Index: chrome/browser/extensions/extension_tabs_module.cc |
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc |
index 054c58e8c36eb20be6150066abf8bcb835bbcc2e..eb5dacf8585f8fb9c37523928ba26c99d561d00e 100644 |
--- a/chrome/browser/extensions/extension_tabs_module.cc |
+++ b/chrome/browser/extensions/extension_tabs_module.cc |
@@ -195,29 +195,6 @@ bool GetTabById(int tab_id, |
return false; |
} |
-// Reads the |value| as either a single integer value or a list of integers. |
-bool ReadOneOrMoreIntegers( |
- 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; |
-} |
- |
// A three state enum to distinguish between when a boolean query argument is |
// set or not. |
enum QueryArg { |
@@ -1141,7 +1118,8 @@ bool HighlightTabsFunction::RunImpl() { |
EXTENSION_FUNCTION_VALIDATE(info->Get(keys::kTabsKey, &tab_value)); |
std::vector<int> tab_indices; |
- EXTENSION_FUNCTION_VALIDATE(ReadOneOrMoreIntegers(tab_value, &tab_indices)); |
+ EXTENSION_FUNCTION_VALIDATE(ExtensionTabUtil::ReadOneOrMoreIntegers( |
+ tab_value, &tab_indices)); |
// Create a new selection model as we read the list of tab indices. |
for (size_t i = 0; i < tab_indices.size(); ++i) { |
@@ -1403,7 +1381,8 @@ bool MoveTabsFunction::RunImpl() { |
EXTENSION_FUNCTION_VALIDATE(args_->Get(0, &tab_value)); |
std::vector<int> tab_ids; |
- EXTENSION_FUNCTION_VALIDATE(ReadOneOrMoreIntegers(tab_value, &tab_ids)); |
+ EXTENSION_FUNCTION_VALIDATE(ExtensionTabUtil::ReadOneOrMoreIntegers( |
+ tab_value, &tab_ids)); |
DictionaryValue* update_props = NULL; |
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &update_props)); |
@@ -1572,7 +1551,8 @@ bool RemoveTabsFunction::RunImpl() { |
EXTENSION_FUNCTION_VALIDATE(args_->Get(0, &tab_value)); |
std::vector<int> tab_ids; |
- EXTENSION_FUNCTION_VALIDATE(ReadOneOrMoreIntegers(tab_value, &tab_ids)); |
+ EXTENSION_FUNCTION_VALIDATE(ExtensionTabUtil::ReadOneOrMoreIntegers( |
+ tab_value, &tab_ids)); |
for (size_t i = 0; i < tab_ids.size(); ++i) { |
Browser* browser = NULL; |