| 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 "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/sessions/session_service.h" | 8 #include "chrome/browser/sessions/session_service.h" |
| 9 #include "chrome/browser/sessions/session_service_factory.h" | 9 #include "chrome/browser/sessions/session_service_factory.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| 11 #include "components/sessions/content/content_tab_client_data.h" |
| 11 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 12 | 13 |
| 13 #if defined(ENABLE_EXTENSIONS) | 14 #if defined(ENABLE_EXTENSIONS) |
| 14 #include "chrome/browser/extensions/tab_helper.h" | 15 #include "chrome/browser/extensions/tab_helper.h" |
| 15 #include "chrome/common/extensions/extension_constants.h" | 16 #include "chrome/common/extensions/extension_constants.h" |
| 16 #include "chrome/common/extensions/extension_metrics.h" | 17 #include "chrome/common/extensions/extension_metrics.h" |
| 17 #include "extensions/browser/extension_registry.h" | 18 #include "extensions/browser/extension_registry.h" |
| 18 #include "extensions/common/extension.h" | 19 #include "extensions/common/extension.h" |
| 19 #include "extensions/common/extension_set.h" | 20 #include "extensions/common/extension_set.h" |
| 20 #endif | 21 #endif |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 const extensions::Extension* extension = | 104 const extensions::Extension* extension = |
| 104 extensions_tab_helper->extension_app(); | 105 extensions_tab_helper->extension_app(); |
| 105 if (extension) | 106 if (extension) |
| 106 extension_app_id = extension->id(); | 107 extension_app_id = extension->id(); |
| 107 } | 108 } |
| 108 #endif | 109 #endif |
| 109 | 110 |
| 110 return extension_app_id; | 111 return extension_app_id; |
| 111 } | 112 } |
| 112 | 113 |
| 114 scoped_ptr<sessions::TabClientData> |
| 115 ChromeTabRestoreServiceClient::GetTabClientDataForWebContents( |
| 116 content::WebContents* web_contents) { |
| 117 return make_scoped_ptr(new sessions::ContentTabClientData(web_contents)); |
| 118 } |
| 119 |
| 113 base::SequencedWorkerPool* ChromeTabRestoreServiceClient::GetBlockingPool() { | 120 base::SequencedWorkerPool* ChromeTabRestoreServiceClient::GetBlockingPool() { |
| 114 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 121 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 115 return content::BrowserThread::GetBlockingPool(); | 122 return content::BrowserThread::GetBlockingPool(); |
| 116 } | 123 } |
| 117 | 124 |
| 118 base::FilePath ChromeTabRestoreServiceClient::GetPathToSaveTo() { | 125 base::FilePath ChromeTabRestoreServiceClient::GetPathToSaveTo() { |
| 119 return profile_->GetPath(); | 126 return profile_->GetPath(); |
| 120 } | 127 } |
| 121 | 128 |
| 122 GURL ChromeTabRestoreServiceClient::GetNewTabURL() { | 129 GURL ChromeTabRestoreServiceClient::GetNewTabURL() { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 146 DCHECK(HasLastSession()); | 153 DCHECK(HasLastSession()); |
| 147 #if defined(ENABLE_SESSION_SERVICE) | 154 #if defined(ENABLE_SESSION_SERVICE) |
| 148 SessionServiceFactory::GetForProfile(profile_) | 155 SessionServiceFactory::GetForProfile(profile_) |
| 149 ->GetLastSession(callback, tracker); | 156 ->GetLastSession(callback, tracker); |
| 150 #endif | 157 #endif |
| 151 } | 158 } |
| 152 | 159 |
| 153 void ChromeTabRestoreServiceClient::OnTabRestored(const GURL& url) { | 160 void ChromeTabRestoreServiceClient::OnTabRestored(const GURL& url) { |
| 154 RecordAppLaunch(profile_, url); | 161 RecordAppLaunch(profile_, url); |
| 155 } | 162 } |
| OLD | NEW |