Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: chrome/browser/ui/webui/new_tab_ui.cc

Issue 6901031: Profile shouldn't own Session/TabRestore services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac build Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/new_tab_ui.cc
diff --git a/chrome/browser/ui/webui/new_tab_ui.cc b/chrome/browser/ui/webui/new_tab_ui.cc
index 69957fcd196191a225f7826eb6f8689e10de225f..91af077573480873f36af43016c9fd45c2cc247b 100644
--- a/chrome/browser/ui/webui/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/new_tab_ui.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/sessions/session_types.h"
#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/sessions/tab_restore_service_delegate.h"
+#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/sessions/tab_restore_service_observer.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/themes/theme_service.h"
@@ -131,10 +132,11 @@ void RecentlyClosedTabsHandler::HandleReopenTab(const ListValue* args) {
void RecentlyClosedTabsHandler::HandleGetRecentlyClosedTabs(
const ListValue* args) {
if (!tab_restore_service_) {
- tab_restore_service_ = web_ui_->GetProfile()->GetTabRestoreService();
+ tab_restore_service_ =
+ TabRestoreServiceFactory::GetForProfile(web_ui_->GetProfile());
- // GetTabRestoreService() can return NULL (i.e., when in Off the
- // Record mode)
+ // TabRestoreServiceFactory::GetForProfile() can return NULL (i.e., when in
+ // Off the Record mode)
if (tab_restore_service_) {
// This does nothing if the tabs have already been loaded or they
// shouldn't be loaded.

Powered by Google App Engine
This is Rietveld 408576698