From cecc93a46dd560fe4157af3d098092eb395324d3 Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Tue, 5 Oct 2010 15:58:55 +0000 Subject: Replace Browser::AddTabWithURL(...) with: - Browser::AddSelectedTabWithURL(const GURL& url, PageTransition::Type transition) -> A good many callsites just wanted a way to open a tab somewhere and select it. - Browser::AddTabWithURL(AddTabWithURLParams* params) -> For the callsites with specialized needs, this new signature allows the parameter set to change as features are added without having to update a bunch of callers every time. BUG=none TEST=existing unit tests Review URL: http://codereview.chromium.org/3599006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61517 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/tab_strip_controller.mm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'chrome/browser/cocoa/tab_strip_controller.mm') diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index 3c0e819..148071e 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -1676,14 +1676,16 @@ private: // Either insert a new tab or open in a current tab. switch (disposition) { - case NEW_FOREGROUND_TAB: + case NEW_FOREGROUND_TAB: { UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs"), browser_->profile()); - browser_->AddTabWithURL(url, GURL(), PageTransition::TYPED, index, - TabStripModel::ADD_SELECTED | - TabStripModel::ADD_FORCE_INDEX, - NULL, std::string(), NULL); + Browser::AddTabWithURLParams params(url, PageTransition::TYPED); + params.index = index; + params.add_types = + TabStripModel::ADD_SELECTED | TabStripModel::ADD_FORCE_INDEX; + browser_->AddTabWithURL(¶ms); break; + } case CURRENT_TAB: UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLOnTab"), browser_->profile()); -- cgit v1.1