diff options
| author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-02 15:15:33 +0000 |
|---|---|---|
| committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-02 15:15:33 +0000 |
| commit | 616381f0a55322de447465573e39612e5af18b31 (patch) | |
| tree | 4cbf687bb163f3dcd95e55e7be7fc9197e0dd8fd /chrome/browser/cocoa | |
| parent | e5925962c61dbb9c8f5a5425ca2dc2953fb6a3e1 (diff) | |
| download | chromium_src-616381f0a55322de447465573e39612e5af18b31.zip chromium_src-616381f0a55322de447465573e39612e5af18b31.tar.gz chromium_src-616381f0a55322de447465573e39612e5af18b31.tar.bz2 | |
Make all browser code use browser::Navigate to open tabs.
BUG=none
TEST=existing unittests. Also, test all places where new tabs and windows are opened from UI, e.g. links in options, new tab button, Ctrl+T, popup windows, etc.
Review URL: http://codereview.chromium.org/3834002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64745 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
| -rw-r--r-- | chrome/browser/cocoa/applescript/window_applescript.mm | 17 | ||||
| -rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 10 |
2 files changed, 16 insertions, 11 deletions
diff --git a/chrome/browser/cocoa/applescript/window_applescript.mm b/chrome/browser/cocoa/applescript/window_applescript.mm index c51e9d8..07401d3 100644 --- a/chrome/browser/cocoa/applescript/window_applescript.mm +++ b/chrome/browser/cocoa/applescript/window_applescript.mm @@ -11,6 +11,7 @@ #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" +#include "chrome/browser/browser_navigator.h" #include "chrome/browser/browser_window.h" #import "chrome/browser/chrome_browser_application_mac.h" #include "chrome/browser/cocoa/applescript/constants_applescript.h" @@ -185,13 +186,15 @@ // Set how long it takes a tab to be created. base::TimeTicks newTabStartTime = base::TimeTicks::Now(); - Browser::AddTabWithURLParams params(GURL(chrome::kChromeUINewTabURL), - PageTransition::TYPED); - params.index = index; - TabContents* contents = browser_->AddTabWithURL(¶ms); - contents->set_new_tab_start_time(newTabStartTime); - - [aTab setTabContent:contents]; + browser::NavigateParams params(browser_, + GURL(chrome::kChromeUINewTabURL), + PageTransition::TYPED); + params.disposition = NEW_FOREGROUND_TAB; + params.tabstrip_index = index; + browser::Navigate(¶ms); + params.target_contents->set_new_tab_start_time(newTabStartTime); + + [aTab setTabContent:params.target_contents]; } - (void)removeFromTabsAtIndex:(int)index { diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index fab844b..e3d5a1d 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -16,6 +16,7 @@ #include "base/sys_string_conversions.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/browser.h" +#include "chrome/browser/browser_navigator.h" #include "chrome/browser/find_bar.h" #include "chrome/browser/find_bar_controller.h" #include "chrome/browser/metrics/user_metrics.h" @@ -1697,11 +1698,12 @@ private: case NEW_FOREGROUND_TAB: { UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs"), browser_->profile()); - Browser::AddTabWithURLParams params(url, PageTransition::TYPED); - params.index = index; - params.add_types = + browser::NavigateParams params(browser_, url, PageTransition::TYPED); + params.disposition = disposition; + params.tabstrip_index = index; + params.tabstrip_add_types = TabStripModel::ADD_SELECTED | TabStripModel::ADD_FORCE_INDEX; - browser_->AddTabWithURL(¶ms); + browser::Navigate(¶ms); break; } case CURRENT_TAB: |
