summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/applescript
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 15:58:55 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 15:58:55 +0000
commitcecc93a46dd560fe4157af3d098092eb395324d3 (patch)
tree18e511cec0772c03f0109bb8a24bd9ad95a4e3fd /chrome/browser/cocoa/applescript
parent07efbd20cead99d9b46df250e6e562bf1696cd4b (diff)
downloadchromium_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/applescript')
-rw-r--r--chrome/browser/cocoa/applescript/window_applescript.mm35
1 files changed, 12 insertions, 23 deletions
diff --git a/chrome/browser/cocoa/applescript/window_applescript.mm b/chrome/browser/cocoa/applescript/window_applescript.mm
index 624f9be..c51e9d8 100644
--- a/chrome/browser/cocoa/applescript/window_applescript.mm
+++ b/chrome/browser/cocoa/applescript/window_applescript.mm
@@ -169,18 +169,12 @@
// Set how long it takes a tab to be created.
base::TimeTicks newTabStartTime = base::TimeTicks::Now();
- TabContents* tabContents = browser_->AddTabWithURL(
- GURL(chrome::kChromeUINewTabURL),
- GURL(),
- PageTransition::TYPED,
- -1, // To indicate tab is inserted at end.
- TabStripModel::ADD_SELECTED,
- NULL,
- std::string(),
- NULL);
- tabContents->set_new_tab_start_time(newTabStartTime);
+ TabContents* contents =
+ browser_->AddSelectedTabWithURL(GURL(chrome::kChromeUINewTabURL),
+ PageTransition::TYPED);
+ contents->set_new_tab_start_time(newTabStartTime);
- [aTab setTabContent:tabContents];
+ [aTab setTabContent:contents];
}
- (void)insertInTabs:(TabAppleScript*)aTab atIndex:(int)index {
@@ -191,18 +185,13 @@
// Set how long it takes a tab to be created.
base::TimeTicks newTabStartTime = base::TimeTicks::Now();
- TabContents* tabContents = browser_->AddTabWithURL(
- GURL(chrome::kChromeUINewTabURL),
- GURL(),
- PageTransition::TYPED,
- index,
- TabStripModel::ADD_SELECTED,
- NULL,
- std::string(),
- NULL);
- tabContents->set_new_tab_start_time(newTabStartTime);
-
- [aTab setTabContent:tabContents];
+ Browser::AddTabWithURLParams params(GURL(chrome::kChromeUINewTabURL),
+ PageTransition::TYPED);
+ params.index = index;
+ TabContents* contents = browser_->AddTabWithURL(&params);
+ contents->set_new_tab_start_time(newTabStartTime);
+
+ [aTab setTabContent:contents];
}
- (void)removeFromTabsAtIndex:(int)index {