OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/metrics/user_metrics_action.h" | 6 #include "base/metrics/user_metrics_action.h" |
7 #include "base/supports_user_data.h" | 7 #include "base/supports_user_data.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 9 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } // namespace | 101 } // namespace |
102 | 102 |
103 void RestoreTab(Browser* browser) { | 103 void RestoreTab(Browser* browser) { |
104 content::RecordAction(base::UserMetricsAction("RestoreTab")); | 104 content::RecordAction(base::UserMetricsAction("RestoreTab")); |
105 sessions::TabRestoreService* service = | 105 sessions::TabRestoreService* service = |
106 TabRestoreServiceFactory::GetForProfile(browser->profile()); | 106 TabRestoreServiceFactory::GetForProfile(browser->profile()); |
107 if (!service) | 107 if (!service) |
108 return; | 108 return; |
109 | 109 |
110 if (service->IsLoaded()) { | 110 if (service->IsLoaded()) { |
111 service->RestoreMostRecentEntry(browser->live_tab_context(), | 111 service->RestoreMostRecentEntry(browser->live_tab_context()); |
112 browser->host_desktop_type()); | |
113 return; | 112 return; |
114 } | 113 } |
115 | 114 |
116 BrowserTabRestorer::CreateIfNecessary(browser); | 115 BrowserTabRestorer::CreateIfNecessary(browser); |
117 } | 116 } |
118 | 117 |
119 } // namespace chrome | 118 } // namespace chrome |
OLD | NEW |