diff options
| author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-05 15:58:55 +0000 |
|---|---|---|
| committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-05 15:58:55 +0000 |
| commit | cecc93a46dd560fe4157af3d098092eb395324d3 (patch) | |
| tree | 18e511cec0772c03f0109bb8a24bd9ad95a4e3fd /chrome/browser/cocoa/tab_strip_controller.mm | |
| parent | 07efbd20cead99d9b46df250e6e562bf1696cd4b (diff) | |
| download | chromium_src-cecc93a46dd560fe4157af3d098092eb395324d3.zip chromium_src-cecc93a46dd560fe4157af3d098092eb395324d3.tar.gz chromium_src-cecc93a46dd560fe4157af3d098092eb395324d3.tar.bz2 | |
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
Diffstat (limited to 'chrome/browser/cocoa/tab_strip_controller.mm')
| -rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 12 |
1 files changed, 7 insertions, 5 deletions
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()); |
