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

Unified Diff: chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.cc

Issue 8662051: retry r112077 - recently closed menu: respect middle click (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/webui/ntp/app_launcher_handler.cc ('k') | chrome/browser/ui/webui/web_ui_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.cc b/chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.cc
index 9d36439976f7f4852cdcaab65313ee34a3a52045..575cf7dfd16f0e8b7d0daf40e0dbc3aa4ff279a0 100644
--- a/chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.cc
+++ b/chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/sessions/tab_restore_service_delegate.h"
#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
+#include "chrome/browser/ui/webui/web_ui_util.h"
#include "chrome/common/url_constants.h"
#include "content/browser/tab_contents/tab_contents.h"
@@ -65,21 +66,21 @@ void RecentlyClosedTabsHandler::HandleReopenTab(const ListValue* args) {
if (!delegate || !tab_restore_service_)
return;
- int session_to_restore;
- if (!ExtractIntegerValue(args, &session_to_restore))
- return;
+ double index = -1.0;
+ CHECK(args->GetDouble(1, &index));
- const TabRestoreService::Entries& entries = tab_restore_service_->entries();
- int index = 0;
- for (TabRestoreService::Entries::const_iterator iter = entries.begin();
- iter != entries.end(); ++iter, ++index) {
- if (session_to_restore == (*iter)->id)
- break;
- }
// There are actually less than 20 restore tab items displayed in the UI.
- UMA_HISTOGRAM_ENUMERATION("NewTabPage.SessionRestore", index, 20);
+ UMA_HISTOGRAM_ENUMERATION("NewTabPage.SessionRestore",
+ static_cast<int>(index), 20);
+
+ double session_to_restore = 0.0;
+ CHECK(args->GetDouble(0, &session_to_restore));
- tab_restore_service_->RestoreEntryById(delegate, session_to_restore, true);
+ WindowOpenDisposition disposition =
+ web_ui_util::GetDispositionFromClick(args, 2);
+ tab_restore_service_->RestoreEntryById(delegate,
+ static_cast<int>(session_to_restore),
+ disposition);
// The current tab has been nuked at this point; don't touch any member
// variables.
}
« no previous file with comments | « chrome/browser/ui/webui/ntp/app_launcher_handler.cc ('k') | chrome/browser/ui/webui/web_ui_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698