summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/applescript/window_applescript.mm17
-rw-r--r--chrome/browser/cocoa/tab_strip_controller.mm10
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(&params);
- 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(&params);
+ 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(&params);
+ browser::Navigate(&params);
break;
}
case CURRENT_TAB: