summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-04 07:58:34 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-04 07:58:34 +0000
commit57c6a6579cf274fe37d6196931a3034d90da7113 (patch)
treeec42313580156ccc039b5fee714ee12259cb08ee /chrome/browser/cocoa
parentb23c9e1f05d474adc327c85d87eacc77554976e0 (diff)
downloadchromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.zip
chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.tar.gz
chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.tar.bz2
Replace all occurrances of WebContents with TabContents.
Review URL: http://codereview.chromium.org/99177 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm13
-rw-r--r--chrome/browser/cocoa/find_bar_cocoa_controller.mm18
-rw-r--r--chrome/browser/cocoa/tab_strip_controller_unittest.mm14
3 files changed, 21 insertions, 24 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index 6df869f..c2cf3e0 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -7,7 +7,7 @@
#include "chrome/app/chrome_dll_resource.h" // IDC_*
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#import "chrome/browser/cocoa/bookmark_bar_controller.h"
@@ -448,9 +448,8 @@ willPositionSheet:(NSWindow *)sheet
// We do not store the focus when closing the tab to work-around bug 4633.
// Some reports seem to show that the focus manager and/or focused view can
// be garbage at that point, it is not clear why.
- if (oldContents && !oldContents->is_being_destroyed() &&
- oldContents->AsWebContents())
- oldContents->AsWebContents()->view()->StoreFocus();
+ if (oldContents && !oldContents->is_being_destroyed())
+ oldContents->view()->StoreFocus();
// Update various elements that are interested in knowing the current
// TabContents.
@@ -469,10 +468,8 @@ willPositionSheet:(NSWindow *)sheet
filename:NO];
if (BrowserList::GetLastActive() == browser_ &&
- !browser_->tabstrip_model()->closing_all() &&
- newContents->AsWebContents()) {
- newContents->AsWebContents()->view()->RestoreFocus();
- }
+ !browser_->tabstrip_model()->closing_all())
+ newContents->view()->RestoreFocus();
#if 0
// TODO(pinkerton):Update as more things become window-specific
diff --git a/chrome/browser/cocoa/find_bar_cocoa_controller.mm b/chrome/browser/cocoa/find_bar_cocoa_controller.mm
index a4229fc..bdd0937 100644
--- a/chrome/browser/cocoa/find_bar_cocoa_controller.mm
+++ b/chrome/browser/cocoa/find_bar_cocoa_controller.mm
@@ -12,7 +12,7 @@
#import "chrome/browser/cocoa/find_bar_cocoa_controller.h"
#import "chrome/browser/cocoa/find_bar_bridge.h"
#import "chrome/browser/cocoa/tab_strip_controller.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/l10n_util.h"
@implementation FindBarCocoaController
@@ -40,14 +40,14 @@
- (IBAction)previousResult:(id)sender {
if (findBarBridge_)
- findBarBridge_->GetFindBarController()->web_contents()->StartFinding(
+ findBarBridge_->GetFindBarController()->tab_contents()->StartFinding(
base::SysNSStringToUTF16([findText_ stringValue]),
false);
}
- (IBAction)nextResult:(id)sender {
if (findBarBridge_)
- findBarBridge_->GetFindBarController()->web_contents()->StartFinding(
+ findBarBridge_->GetFindBarController()->tab_contents()->StartFinding(
base::SysNSStringToUTF16([findText_ stringValue]),
true);
}
@@ -80,18 +80,18 @@
if (!findBarBridge_)
return;
- WebContents* web_contents =
- findBarBridge_->GetFindBarController()->web_contents();
- if (!web_contents)
+ TabContents* tab_contents =
+ findBarBridge_->GetFindBarController()->tab_contents();
+ if (!tab_contents)
return;
string16 findText = base::SysNSStringToUTF16([findText_ stringValue]);
if (findText.length() > 0) {
- web_contents->StartFinding(findText, true);
+ tab_contents->StartFinding(findText, true);
} else {
// The textbox is empty so we reset.
- web_contents->StopFinding(true); // true = clear selection on page.
- [self updateUIForFindResult:web_contents->find_result()
+ tab_contents->StopFinding(true); // true = clear selection on page.
+ [self updateUIForFindResult:tab_contents->find_result()
withText:string16()];
}
}
diff --git a/chrome/browser/cocoa/tab_strip_controller_unittest.mm b/chrome/browser/cocoa/tab_strip_controller_unittest.mm
index f60ab03..386b8e1 100644
--- a/chrome/browser/cocoa/tab_strip_controller_unittest.mm
+++ b/chrome/browser/cocoa/tab_strip_controller_unittest.mm
@@ -7,7 +7,7 @@
#include "chrome/browser/cocoa/browser_test_helper.h"
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#import "chrome/browser/cocoa/tab_strip_controller.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -97,7 +97,7 @@ class TabStripControllerTest : public testing::Test {
};
TEST_F(TabStripControllerTest, GrowBox) {
- // TODO(pinkerton): Creating a WebContents crashes an unrelated test, even
+ // TODO(pinkerton): Creating a TabContents crashes an unrelated test, even
// if you don't do anything with it. http://crbug.com/10899
}
@@ -106,24 +106,24 @@ TEST_F(TabStripControllerTest, GrowBox) {
TEST_F(TabStripControllerTest, AddRemoveTabs) {
EXPECT_TRUE(model_->empty());
#if 0
- // TODO(pinkerton): Creating a WebContents crashes an unrelated test, even
+ // TODO(pinkerton): Creating a TabContents crashes an unrelated test, even
// if you don't do anything with it. http://crbug.com/10899
SiteInstance* instance =
SiteInstance::CreateSiteInstance(browser_helper_.profile());
- WebContents* tab_contents =
- new WebContents(browser_helper_.profile(), instance);
+ TabContents* tab_contents =
+ new TabContents(browser_helper_.profile(), instance);
model_->AppendTabContents(tab_contents, true);
EXPECT_EQ(model_->count(), 1);
#endif
}
TEST_F(TabStripControllerTest, SelectTab) {
- // TODO(pinkerton): Creating a WebContents crashes an unrelated test, even
+ // TODO(pinkerton): Creating a TabContents crashes an unrelated test, even
// if you don't do anything with it. http://crbug.com/10899
}
TEST_F(TabStripControllerTest, RearrangeTabs) {
- // TODO(pinkerton): Creating a WebContents crashes an unrelated test, even
+ // TODO(pinkerton): Creating a TabContents crashes an unrelated test, even
// if you don't do anything with it. http://crbug.com/10899
}