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

Unified Diff: chrome/browser/ui/android/tab_model/tab_model.cc

Issue 866443003: Push API: Don't require notification if tab is visible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ycm_outdir
Patch Set: Created 5 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
Index: chrome/browser/ui/android/tab_model/tab_model.cc
diff --git a/chrome/browser/ui/android/tab_model/tab_model.cc b/chrome/browser/ui/android/tab_model/tab_model.cc
index 2d5bd6a04f043705bbcf52b55161a7cb80fd45f0..ebdc74fce69ed506b8a5f9950bbe9310a2530819 100644
--- a/chrome/browser/ui/android/tab_model/tab_model.cc
+++ b/chrome/browser/ui/android/tab_model/tab_model.cc
@@ -14,6 +14,8 @@
using content::NotificationService;
+static int INVALID_TAB_INDEX = -1;
Michael van Ouwerkerk 2015/01/21 19:13:22 Similar comment as in TabList.java?
johnme 2015/01/21 19:32:19 Done.
+
TabModel::TabModel(Profile* profile)
: profile_(profile),
synced_window_delegate_(
@@ -58,6 +60,13 @@ SessionID::id_type TabModel::GetSessionId() const {
return session_id_.id();
}
+content::WebContents* TabModel::GetActiveWebContents() const {
+ int active_index = GetActiveIndex();
+ if (active_index == INVALID_TAB_INDEX)
+ return nullptr;
+ return GetWebContentsAt(active_index);
+}
+
void TabModel::BroadcastSessionRestoreComplete() {
if (profile_) {
NotificationService::current()->Notify(

Powered by Google App Engine
This is Rietveld 408576698