Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Unified Diff: chrome/browser/ui/cocoa/applescript/window_applescript.mm

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/applescript/window_applescript.mm
===================================================================
--- chrome/browser/ui/cocoa/applescript/window_applescript.mm (revision 145001)
+++ chrome/browser/ui/cocoa/applescript/window_applescript.mm (working copy)
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_navigator.h"
+#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/cocoa/applescript/constants_applescript.h"
#include "chrome/browser/ui/cocoa/applescript/error_applescript.h"
@@ -117,7 +118,7 @@
// Note: applescript is 1-based, that is lists begin with index 1.
int atIndex = [anActiveTabIndex intValue] - 1;
if (atIndex >= 0 && atIndex < browser_->tab_count())
- browser_->ActivateTabAt(atIndex, true);
+ chrome::ActivateTabAt(browser_, atIndex, true);
else
AppleScript::SetError(AppleScript::errInvalidTabIndex);
}
@@ -139,7 +140,7 @@
- (TabAppleScript*)activeTab {
TabAppleScript* currentTab =
[[[TabAppleScript alloc]
- initWithTabContent:browser_->GetActiveTabContents()]
+ initWithTabContent:chrome::GetActiveTabContents(browser_)]
autorelease];
[currentTab setContainer:self
property:AppleScript::kTabsProperty];
@@ -152,7 +153,7 @@
for (int i = 0; i < browser_->tab_count(); ++i) {
// Check to see if tab is closing.
- TabContents* tab_contents = browser_->GetTabContentsAt(i);
+ TabContents* tab_contents = chrome::GetTabContentsAt(browser_, i);
if (tab_contents->in_destructor()) {
continue;
}
@@ -174,9 +175,10 @@
// Set how long it takes a tab to be created.
base::TimeTicks newTabStartTime = base::TimeTicks::Now();
- TabContents* contents =
- browser_->AddSelectedTabWithURL(GURL(chrome::kChromeUINewTabURL),
- content::PAGE_TRANSITION_TYPED);
+ TabContents* contents = chrome::AddSelectedTabWithURL(
+ browser_,
+ GURL(chrome::kChromeUINewTabURL),
+ content::PAGE_TRANSITION_TYPED);
contents->web_contents()->SetNewTabStartTime(newTabStartTime);
[aTab setTabContent:contents];
}
@@ -202,7 +204,7 @@
}
- (void)removeFromTabsAtIndex:(int)index {
- browser_->CloseTabContents(browser_->GetWebContentsAt(index));
+ chrome::CloseWebContents(browser_, chrome::GetWebContentsAt(browser_, index));
}
- (NSNumber*)orderedIndex {

Powered by Google App Engine
This is Rietveld 408576698