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

Unified Diff: chrome/browser/ui/browser_tabstrip.cc

Issue 74133003: linux-aura: Restore middle-click on new-tab button behaviour. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-nit Created 7 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/browser_tabstrip.h ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_tabstrip.cc
diff --git a/chrome/browser/ui/browser_tabstrip.cc b/chrome/browser/ui/browser_tabstrip.cc
index ba95d584a4e41adb2d820ef399bb52b70cf8ea25..d0bee662f8f6322934f59c0161ece4c2ddc35261 100644
--- a/chrome/browser/ui/browser_tabstrip.cc
+++ b/chrome/browser/ui/browser_tabstrip.cc
@@ -18,21 +18,26 @@
namespace chrome {
-void AddBlankTabAt(Browser* browser, int index, bool foreground) {
+void AddURLTabAt(Browser* browser, const GURL& url, int idx, bool foreground) {
// Time new tab page creation time. We keep track of the timing data in
// WebContents, but we want to include the time it takes to create the
// WebContents object too.
base::TimeTicks new_tab_start_time = base::TimeTicks::Now();
- chrome::NavigateParams params(browser, GURL(chrome::kChromeUINewTabURL),
- content::PAGE_TRANSITION_TYPED);
+ chrome::NavigateParams params(browser,
+ url.is_empty() ? GURL(chrome::kChromeUINewTabURL) : url,
+ content::PAGE_TRANSITION_TYPED);
params.disposition = foreground ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB;
- params.tabstrip_index = index;
+ params.tabstrip_index = idx;
chrome::Navigate(&params);
CoreTabHelper* core_tab_helper =
CoreTabHelper::FromWebContents(params.target_contents);
core_tab_helper->set_new_tab_start_time(new_tab_start_time);
}
+void AddBlankTabAt(Browser* browser, int index, bool foreground) {
+ AddURLTabAt(browser, GURL(), index, foreground);
+}
+
content::WebContents* AddSelectedTabWithURL(
Browser* browser,
const GURL& url,
« no previous file with comments | « chrome/browser/ui/browser_tabstrip.h ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698