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( |