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

Unified Diff: chrome/browser/ui/gtk/global_history_menu.cc

Issue 6901031: Profile shouldn't own Session/TabRestore services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again and hope upload works this time 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/gtk/global_history_menu.cc
diff --git a/chrome/browser/ui/gtk/global_history_menu.cc b/chrome/browser/ui/gtk/global_history_menu.cc
index 3df4b58523376c1b7952a524b251a7f3f7b2b299..1fe561fa185a329336d5151f99b5115eb32cf580 100644
--- a/chrome/browser/ui/gtk/global_history_menu.cc
+++ b/chrome/browser/ui/gtk/global_history_menu.cc
@@ -11,6 +11,8 @@
#include "base/string_number_conversions.h"
#include "chrome/browser/favicon_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/sessions/tab_restore_service.h"
+#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
#include "chrome/browser/ui/gtk/global_menu_bar.h"
@@ -112,7 +114,7 @@ void GlobalHistoryMenu::Init(GtkWidget* history_menu) {
default_favicon_ = GtkThemeService::GetDefaultFavicon(true);
if (profile_) {
- tab_restore_service_ = profile_->GetTabRestoreService();
+ tab_restore_service_ = TabRestoreServiceFactory::GetForProfile(profile_);
if (tab_restore_service_) {
tab_restore_service_->LoadTabsFromLastSession();
tab_restore_service_->AddObserver(this);
@@ -450,7 +452,8 @@ void GlobalHistoryMenu::OnRecentlyClosedItemActivated(GtkWidget* sender) {
// If this item can be restored using TabRestoreService, do so. Otherwise,
// just load the URL.
- TabRestoreService* service = browser_->profile()->GetTabRestoreService();
+ TabRestoreService* service =
+ TabRestoreServiceFactory::GetForProfile(browser_->profile());
if (item->session_id && service) {
service->RestoreEntryById(browser_->tab_restore_service_delegate(),
item->session_id, false);
« no previous file with comments | « chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698