| OLD | NEW | 
|    1 // Copyright 2015 The Chromium Authors. All rights reserved. |    1 // Copyright 2015 The Chromium Authors. All rights reserved. | 
|    2 // Use of this source code is governed by a BSD-style license that can be |    2 // Use of this source code is governed by a BSD-style license that can be | 
|    3 // found in the LICENSE file. |    3 // found in the LICENSE file. | 
|    4  |    4  | 
|    5 #include "chrome/browser/sessions/chrome_tab_restore_service_client.h" |    5 #include "chrome/browser/sessions/chrome_tab_restore_service_client.h" | 
|    6  |    6  | 
|    7 #include "build/build_config.h" |    7 #include "build/build_config.h" | 
|    8 #include "chrome/browser/profiles/profile.h" |    8 #include "chrome/browser/profiles/profile.h" | 
|    9 #include "chrome/browser/sessions/session_service.h" |    9 #include "chrome/browser/sessions/session_service.h" | 
|   10 #include "chrome/browser/sessions/session_service_factory.h" |   10 #include "chrome/browser/sessions/session_service_factory.h" | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   44 } |   44 } | 
|   45  |   45  | 
|   46 }  // namespace |   46 }  // namespace | 
|   47  |   47  | 
|   48 ChromeTabRestoreServiceClient::ChromeTabRestoreServiceClient(Profile* profile) |   48 ChromeTabRestoreServiceClient::ChromeTabRestoreServiceClient(Profile* profile) | 
|   49     : profile_(profile) {} |   49     : profile_(profile) {} | 
|   50  |   50  | 
|   51 ChromeTabRestoreServiceClient::~ChromeTabRestoreServiceClient() {} |   51 ChromeTabRestoreServiceClient::~ChromeTabRestoreServiceClient() {} | 
|   52  |   52  | 
|   53 sessions::LiveTabContext* ChromeTabRestoreServiceClient::CreateLiveTabContext( |   53 sessions::LiveTabContext* ChromeTabRestoreServiceClient::CreateLiveTabContext( | 
|   54     const std::string& app_name) { |   54     const std::string& app_name, | 
 |   55     const gfx::Rect& bounds, | 
 |   56     ui::WindowShowState show_state, | 
 |   57     const std::string& workspace) { | 
|   55 #if defined(OS_ANDROID) |   58 #if defined(OS_ANDROID) | 
|   56   // Android does not support creating a LiveTabContext here. |   59   // Android does not support creating a LiveTabContext here. | 
|   57   NOTREACHED(); |   60   NOTREACHED(); | 
|   58   return nullptr; |   61   return nullptr; | 
|   59 #else |   62 #else | 
|   60   return BrowserLiveTabContext::Create(profile_, app_name); |   63   return BrowserLiveTabContext::Create(profile_, app_name, bounds, show_state, | 
 |   64                                        workspace); | 
|   61 #endif |   65 #endif | 
|   62 } |   66 } | 
|   63  |   67  | 
|   64 sessions::LiveTabContext* |   68 sessions::LiveTabContext* | 
|   65 ChromeTabRestoreServiceClient::FindLiveTabContextForTab( |   69 ChromeTabRestoreServiceClient::FindLiveTabContextForTab( | 
|   66     const sessions::LiveTab* tab) { |   70     const sessions::LiveTab* tab) { | 
|   67 #if defined(OS_ANDROID) |   71 #if defined(OS_ANDROID) | 
|   68   return AndroidLiveTabContext::FindContextForWebContents( |   72   return AndroidLiveTabContext::FindContextForWebContents( | 
|   69       static_cast<const sessions::ContentLiveTab*>(tab)->web_contents()); |   73       static_cast<const sessions::ContentLiveTab*>(tab)->web_contents()); | 
|   70 #else |   74 #else | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  138   DCHECK(HasLastSession()); |  142   DCHECK(HasLastSession()); | 
|  139 #if BUILDFLAG(ENABLE_SESSION_SERVICE) |  143 #if BUILDFLAG(ENABLE_SESSION_SERVICE) | 
|  140   SessionServiceFactory::GetForProfile(profile_) |  144   SessionServiceFactory::GetForProfile(profile_) | 
|  141       ->GetLastSession(callback, tracker); |  145       ->GetLastSession(callback, tracker); | 
|  142 #endif |  146 #endif | 
|  143 } |  147 } | 
|  144  |  148  | 
|  145 void ChromeTabRestoreServiceClient::OnTabRestored(const GURL& url) { |  149 void ChromeTabRestoreServiceClient::OnTabRestored(const GURL& url) { | 
|  146   RecordAppLaunch(profile_, url); |  150   RecordAppLaunch(profile_, url); | 
|  147 } |  151 } | 
| OLD | NEW |