| 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 6d75288229fcc37d0a0f4bf0f32d6a0b3dcac8ea..bf3474635016dd65849890b32688fbf341de1a83 100644
|
| --- a/chrome/browser/extensions/extension_tabs_module.cc
|
| +++ b/chrome/browser/extensions/extension_tabs_module.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// 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.
|
|
|
| @@ -782,7 +782,7 @@ bool QueryTabsFunction::RunImpl() {
|
| EXTENSION_FUNCTION_VALIDATE(
|
| query->GetString(keys::kTitleKey, &title));
|
|
|
| - int window_id = -1;
|
| + int window_id = extension_misc::kUnknownWindowId;
|
| if (query->HasKey(keys::kWindowIdKey))
|
| EXTENSION_FUNCTION_VALIDATE(
|
| query->GetInteger(keys::kWindowIdKey, &window_id));
|
| @@ -804,6 +804,10 @@ bool QueryTabsFunction::RunImpl() {
|
| if (window_id >= 0 && window_id != ExtensionTabUtil::GetWindowId(*browser))
|
| continue;
|
|
|
| + if (window_id == extension_misc::kCurrentWindowId &&
|
| + *browser != GetCurrentBrowser())
|
| + continue;
|
| +
|
| if (!window_type.empty() &&
|
| window_type != ExtensionTabUtil::GetWindowTypeText(*browser))
|
| continue;
|
|
|