| 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 07af114755ff44779ccf5f3cfa9f1657704d6a51..9cec1d5facf2df70d3473cd56f0c30b42a1f93e7 100644
|
| --- a/chrome/browser/extensions/extension_tabs_module.cc
|
| +++ b/chrome/browser/extensions/extension_tabs_module.cc
|
| @@ -196,29 +196,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 {
|
| @@ -1142,7 +1119,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) {
|
| @@ -1404,7 +1382,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));
|
| @@ -1573,7 +1552,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;
|
|
|