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

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

Issue 1239643004: extensions: tabs: set tab id to -1 for app/devtools windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support no tab id and NONE tab id Created 5 years, 5 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
Index: chrome/browser/extensions/extension_tab_util.cc
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index 5d4b89b667faac9facefd526cd0de2a974db0499..1bb6b176f3028bc68a06b005618ff443e658535f 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -315,6 +315,9 @@ int ExtensionTabUtil::GetWindowIdOfTabStripModel(
}
int ExtensionTabUtil::GetTabId(const WebContents* web_contents) {
+ Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
+ if (browser && browser->is_devtools())
not at google - send to devlin 2015/07/17 16:44:58 ExtensionTabUtil::BrowserSupportsTabs(browser)
+ return -1;
return SessionTabHelper::IdForTab(web_contents);
}
@@ -489,6 +492,8 @@ bool ExtensionTabUtil::GetTabById(int tab_id,
TabStripModel** tab_strip,
WebContents** contents,
int* tab_index) {
+ if (tab_id == api::tabs::TAB_ID_NONE)
+ return false;
Profile* profile = Profile::FromBrowserContext(browser_context);
Profile* incognito_profile =
include_incognito && profile->HasOffTheRecordProfile() ?

Powered by Google App Engine
This is Rietveld 408576698