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

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

Issue 6660028: Decouple TabRestoreService from Browser (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix mac build and handle NULL in delegate statics Created 9 years, 9 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
« no previous file with comments | « chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 25ca83da2d3b4a6ff202708900098c0fc4d2e09c..7beaf3ca7de7f45c4ffd2a37742721a1e3a7de0b 100644
--- a/chrome/browser/ui/webui/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/new_tab_ui.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/profiles/profile.h"
#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_observer.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/themes/browser_theme_provider.h"
@@ -114,14 +115,15 @@ RecentlyClosedTabsHandler::~RecentlyClosedTabsHandler() {
}
void RecentlyClosedTabsHandler::HandleReopenTab(const ListValue* args) {
- Browser* browser = Browser::GetBrowserForController(
+ TabRestoreServiceDelegate* delegate =
+ TabRestoreServiceDelegate::FindDelegateForController(
&web_ui_->tab_contents()->controller(), NULL);
- if (!browser)
+ if (!delegate)
return;
int session_to_restore;
if (ExtractIntegerValue(args, &session_to_restore))
- tab_restore_service_->RestoreEntryById(browser, session_to_restore, true);
+ tab_restore_service_->RestoreEntryById(delegate, session_to_restore, true);
// The current tab has been nuked at this point; don't touch any member
// variables.
}
« no previous file with comments | « chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698