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

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: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9dd5564d40eb7532a0e129b0e3b26330d509ec42 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -350,10 +350,13 @@ base::ListValue* ExtensionTabUtil::CreateTabList(
base::ListValue* tab_list = new base::ListValue();
TabStripModel* tab_strip = browser->tab_strip_model();
for (int i = 0; i < tab_strip->count(); ++i) {
- tab_list->Append(CreateTabValue(tab_strip->GetWebContentsAt(i),
- tab_strip,
- i,
- extension));
+ base::DictionaryValue* value =
+ CreateTabValue(tab_strip->GetWebContentsAt(i), tab_strip, i, extension);
+ // Remove tab id for devtools as we don't want them to be
+ // manipulated through the chrome.tabs API.
+ if (browser->is_devtools())
dgozman 2015/07/14 15:16:16 What about TabUpdatedEvent or TabsGetCurrent? Perh
not at google - send to devlin 2015/07/14 17:15:13 CreateTabValue looks right to me.
not at google - send to devlin 2015/07/14 17:40:00 Actually, GetTabID looks even right-er to me. More
not at google - send to devlin 2015/07/14 17:41:09 More comments: In fact I wonder if this would bre
+ value->Remove(keys::kIdKey, nullptr);
+ tab_list->Append(value);
}
return tab_list;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698