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

Unified Diff: chrome/browser/extensions/api/sessions/sessions_api.cc

Issue 673933002: Correctly set tab.active not tab.selected in the chrome.sessions API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 6 years, 2 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/browser/extensions/api/sessions/sessions_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/sessions/sessions_api.cc
diff --git a/chrome/browser/extensions/api/sessions/sessions_api.cc b/chrome/browser/extensions/api/sessions/sessions_api.cc
index aff46ee18f510b75022664bb13af687c640ecfa8..0b7a1a71601b21940be8b9b68dfaa4c01282102f 100644
--- a/chrome/browser/extensions/api/sessions/sessions_api.cc
+++ b/chrome/browser/extensions/api/sessions/sessions_api.cc
@@ -97,13 +97,12 @@ scoped_ptr<tabs::Tab> CreateTabModelHelper(
}
tab_struct->index = index;
tab_struct->pinned = pinned;
- tab_struct->selected = index == selected_index;
- tab_struct->active = false;
- // TODO(kalman): Really? Docs say that selected is deprecated and to use
- // highlighted instead, but here we're setting selected but not highlighted.
- // Are they supposed to be the same or not?
- tab_struct->highlighted = false;
- tab_struct->incognito = false;
+ // Note: |selected_index| from the sync sessions model is what we call
+ // "active" in extensions terminology. "selected" is deprecated because it's
+ // not clear whether it means "active" (user can see) or "highlighted" (user
+ // has highlighted, since you can select tabs without bringing them into the
+ // foreground).
+ tab_struct->active = index == selected_index;
ExtensionTabUtil::ScrubTabForExtension(extension, tab_struct.get());
return tab_struct.Pass();
}
« no previous file with comments | « no previous file | chrome/browser/extensions/api/sessions/sessions_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698