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

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: Change new tab UI to use delegate interface 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/browser_tab_restore_service_delegate.cc ('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..0d7bad3d004b1cd14af31bea2a9b4e45f08b82c1 100644
--- a/chrome/browser/ui/webui/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/new_tab_ui.cc
@@ -21,10 +21,12 @@
#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"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
sky 2011/03/14 18:31:25 You shouldn't need this include, right?
#include "chrome/browser/ui/webui/app_launcher_handler.h"
#include "chrome/browser/ui/webui/foreign_session_handler.h"
#include "chrome/browser/ui/webui/most_visited_handler.h"
@@ -114,14 +116,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/browser_tab_restore_service_delegate.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698