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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_event_router.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: set tab id to -1 in session api 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/api/tabs/tabs_event_router.cc
diff --git a/chrome/browser/extensions/api/tabs/tabs_event_router.cc b/chrome/browser/extensions/api/tabs/tabs_event_router.cc
index abf5243e991e0bd01abc97214ddd362cb3bed561..f0c02072b827a8662819727b5a0a9bc4b68a7169 100644
--- a/chrome/browser/extensions/api/tabs/tabs_event_router.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_event_router.cc
@@ -129,7 +129,7 @@ TabsEventRouter::TabsEventRouter(Profile* profile)
// Also catch up our internal bookkeeping of tab entries.
Browser* browser = *it;
- if (browser->tab_strip_model()) {
+ if (!browser->is_devtools() && browser->tab_strip_model()) {
for (int i = 0; i < browser->tab_strip_model()->count(); ++i) {
WebContents* contents = browser->tab_strip_model()->GetWebContentsAt(i);
int tab_id = ExtensionTabUtil::GetTabId(contents);
@@ -148,7 +148,7 @@ void TabsEventRouter::OnBrowserAdded(Browser* browser) {
}
void TabsEventRouter::RegisterForBrowserNotifications(Browser* browser) {
- if (!profile_->IsSameProfile(browser->profile()))
+ if (!profile_->IsSameProfile(browser->profile()) || browser->is_devtools())
return;
// Start listening to TabStripModel events for this browser.
TabStripModel* tab_strip = browser->tab_strip_model();

Powered by Google App Engine
This is Rietveld 408576698