Chromium Code Reviews| 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..304753c3ff8994a6d8319ee9161fe61e1dcbb5b4 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::kCurrentWindowId - 1; |
|
asargent_no_longer_on_chrome
2012/01/10 20:06:46
nit: can you use whatever c++ constant corresponds
jstritar
2012/01/10 20:29:22
Ah, much better... done.
|
| 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; |