Chromium Code Reviews| Index: chrome/browser/sessions/chrome_tab_restore_service_client.cc |
| diff --git a/chrome/browser/sessions/chrome_tab_restore_service_client.cc b/chrome/browser/sessions/chrome_tab_restore_service_client.cc |
| index 01f69fd75597917f2a663c0e5c3f4863b7ac067f..4d21ef4943b6e90cd1ec0ab18546c387ec87417c 100644 |
| --- a/chrome/browser/sessions/chrome_tab_restore_service_client.cc |
| +++ b/chrome/browser/sessions/chrome_tab_restore_service_client.cc |
| @@ -23,6 +23,8 @@ |
| #if !defined(OS_ANDROID) |
| #include "chrome/browser/ui/browser_live_tab_context.h" |
| +#else |
| +#include "chrome/browser/ui/android/tab_model/android_live_tab_context.h" |
| #endif |
| namespace { |
| @@ -51,8 +53,9 @@ ChromeTabRestoreServiceClient::~ChromeTabRestoreServiceClient() {} |
| sessions::LiveTabContext* ChromeTabRestoreServiceClient::CreateLiveTabContext( |
| const std::string& app_name) { |
| #if defined(OS_ANDROID) |
| - // Android does not support LiveTabContext, as tab persistence |
| - // is implemented on the Java side. |
| + // Android does not initialize LiveTabContext here, and tab persistence is |
|
Theresa
2016/07/07 19:00:13
nit: maybe something like "Android does not suppor
xingliu
2016/07/08 21:26:48
Done.
|
| + // implemented in java. |
| + NOTREACHED(); |
| return nullptr; |
| #else |
| return BrowserLiveTabContext::Create(profile_, app_name); |
| @@ -63,9 +66,8 @@ sessions::LiveTabContext* |
| ChromeTabRestoreServiceClient::FindLiveTabContextForTab( |
| const sessions::LiveTab* tab) { |
| #if defined(OS_ANDROID) |
| - // Android does not support LiveTabContext, as tab persistence |
| - // is implemented on the Java side. |
| - return nullptr; |
| + return AndroidLiveTabContext::FindContextForWebContents( |
| + static_cast<const sessions::ContentLiveTab*>(tab)->web_contents()); |
| #else |
| return BrowserLiveTabContext::FindContextForWebContents( |
| static_cast<const sessions::ContentLiveTab*>(tab)->web_contents()); |
| @@ -76,9 +78,7 @@ sessions::LiveTabContext* |
| ChromeTabRestoreServiceClient::FindLiveTabContextWithID( |
| SessionID::id_type desired_id) { |
| #if defined(OS_ANDROID) |
| - // Android does not support LiveTabContext, as tab persistence |
| - // is implemented on the Java side. |
| - return nullptr; |
| + return AndroidLiveTabContext::FindContextWithID(desired_id);; |
| #else |
| return BrowserLiveTabContext::FindContextWithID(desired_id); |
| #endif |