| 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 1eb5e910082b2ecafaa4e8cb77f4603826361d74..bad6bb265580ad2d01104c84a70808b1cc24bccf 100644
|
| --- a/chrome/browser/sessions/chrome_tab_restore_service_client.cc
|
| +++ b/chrome/browser/sessions/chrome_tab_restore_service_client.cc
|
| @@ -7,12 +7,47 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/sessions/session_service.h"
|
| #include "chrome/browser/sessions/session_service_factory.h"
|
| +#include "chrome/common/url_constants.h"
|
| +
|
| +#if defined(ENABLE_EXTENSIONS)
|
| +#include "chrome/common/extensions/extension_constants.h"
|
| +#include "chrome/common/extensions/extension_metrics.h"
|
| +#include "extensions/browser/extension_registry.h"
|
| +#include "extensions/common/extension.h"
|
| +#include "extensions/common/extension_set.h"
|
| +#endif
|
| +
|
| +namespace {
|
| +
|
| +void RecordAppLaunch(Profile* profile, const GURL& url) {
|
| +#if defined(ENABLE_EXTENSIONS)
|
| + const extensions::Extension* extension =
|
| + extensions::ExtensionRegistry::Get(profile)
|
| + ->enabled_extensions()
|
| + .GetAppByURL(url);
|
| + if (!extension)
|
| + return;
|
| +
|
| + extensions::RecordAppLaunchType(
|
| + extension_misc::APP_LAUNCH_NTP_RECENTLY_CLOSED, extension->GetType());
|
| +#endif // defined(ENABLE_EXTENSIONS)
|
| +}
|
| +
|
| +} // namespace
|
|
|
| ChromeTabRestoreServiceClient::ChromeTabRestoreServiceClient(Profile* profile)
|
| : profile_(profile) {}
|
|
|
| ChromeTabRestoreServiceClient::~ChromeTabRestoreServiceClient() {}
|
|
|
| +base::FilePath ChromeTabRestoreServiceClient::GetPathToSaveTo() {
|
| + return profile_->GetPath();
|
| +}
|
| +
|
| +GURL ChromeTabRestoreServiceClient::GetNewTabURL() {
|
| + return GURL(chrome::kChromeUINewTabURL);
|
| +}
|
| +
|
| bool ChromeTabRestoreServiceClient::HasLastSession() {
|
| #if defined(ENABLE_SESSION_SERVICE)
|
| SessionService* session_service =
|
| @@ -39,3 +74,7 @@ void ChromeTabRestoreServiceClient::GetLastSession(
|
| ->GetLastSession(callback, tracker);
|
| #endif
|
| }
|
| +
|
| +void ChromeTabRestoreServiceClient::OnTabRestored(const GURL& url) {
|
| + RecordAppLaunch(profile_, url);
|
| +}
|
|
|