Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Unified Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 9162002: Query the current window with chrome.tabs.query using -1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/api/tabs.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | chrome/common/extensions/api/tabs.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698