summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-02 20:15:25 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-02 20:15:25 +0000
commit4b19ea5f055ab1c822f9ab6d57c8db59212db395 (patch)
treea9613560881a8f5db6cbd0a478a4581d85145086 /content
parentcff06c5779f85713bc4b09ce110ec26544322d64 (diff)
downloadchromium_src-4b19ea5f055ab1c822f9ab6d57c8db59212db395.zip
chromium_src-4b19ea5f055ab1c822f9ab6d57c8db59212db395.tar.gz
chromium_src-4b19ea5f055ab1c822f9ab6d57c8db59212db395.tar.bz2
Replace the TabContents* accessors with WebContents* in InterstitialPage, BackgroundContents and NativeTabContentsContainer and update the related code.
BUG=98716 TBR=joi Review URL: http://codereview.chromium.org/9064002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116108 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/tab_contents/interstitial_page.cc20
-rw-r--r--content/browser/tab_contents/interstitial_page.h12
2 files changed, 23 insertions, 9 deletions
diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc
index 6c89fcb..cbc0b29 100644
--- a/content/browser/tab_contents/interstitial_page.cc
+++ b/content/browser/tab_contents/interstitial_page.cc
@@ -115,10 +115,10 @@ class InterstitialPage::InterstitialPageRVHViewDelegate
InterstitialPage::InterstitialPageMap*
InterstitialPage::tab_to_interstitial_page_ = NULL;
-InterstitialPage::InterstitialPage(TabContents* tab,
+InterstitialPage::InterstitialPage(WebContents* tab,
bool new_navigation,
const GURL& url)
- : tab_(tab),
+ : tab_(static_cast<TabContents*>(tab)),
url_(url),
new_navigation_(new_navigation),
should_discard_pending_nav_entry_(new_navigation),
@@ -419,6 +419,10 @@ void InterstitialPage::HandleKeyboardEvent(
return tab_->HandleKeyboardEvent(event);
}
+WebContents* InterstitialPage::tab() const {
+ return tab_;
+}
+
RenderViewHost* InterstitialPage::CreateRenderViewHost() {
RenderViewHost* render_view_host = new RenderViewHost(
SiteInstance::CreateSiteInstance(tab()->GetBrowserContext()),
@@ -591,8 +595,9 @@ void InterstitialPage::InitInterstitialPageMap() {
// static
InterstitialPage* InterstitialPage::GetInterstitialPage(
- TabContents* tab_contents) {
+ WebContents* web_contents) {
InitInterstitialPageMap();
+ TabContents* tab_contents = static_cast<TabContents*>(web_contents);
InterstitialPageMap::const_iterator iter =
tab_to_interstitial_page_->find(tab_contents);
if (iter == tab_to_interstitial_page_->end())
@@ -673,8 +678,13 @@ void InterstitialPage::InterstitialPageRVHViewDelegate::GotFocus() {
void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus(
bool reverse) {
- if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
- interstitial_page_->tab()->GetViewDelegate()->TakeFocus(reverse);
+ if (!interstitial_page_->tab())
+ return;
+ TabContents* tab = static_cast<TabContents*>(interstitial_page_->tab());
+ if (!tab->GetViewDelegate())
+ return;
+
+ tab->GetViewDelegate()->TakeFocus(reverse);
}
void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply(
diff --git a/content/browser/tab_contents/interstitial_page.h b/content/browser/tab_contents/interstitial_page.h
index 4088e8a..ce786bf 100644
--- a/content/browser/tab_contents/interstitial_page.h
+++ b/content/browser/tab_contents/interstitial_page.h
@@ -24,6 +24,7 @@ class TabContentsView;
namespace content {
class NavigationEntry;
+class WebContents;
}
// This class is a base class for interstitial pages, pages that show some
@@ -60,7 +61,9 @@ class CONTENT_EXPORT InterstitialPage : public content::NotificationObserver,
// added to the navigation controller (so the interstitial page appears as a
// new navigation entry). |new_navigation| should be false when the
// interstitial was triggered by a loading a sub-resource in a page.
- InterstitialPage(TabContents* tab, bool new_navigation, const GURL& url);
+ InterstitialPage(content::WebContents* tab,
+ bool new_navigation,
+ const GURL& url);
virtual ~InterstitialPage();
// Shows the interstitial page in the tab.
@@ -70,8 +73,9 @@ class CONTENT_EXPORT InterstitialPage : public content::NotificationObserver,
void Hide();
// Retrieves the InterstitialPage if any associated with the specified
- // |tab_contents| (used by ui tests).
- static InterstitialPage* GetInterstitialPage(TabContents* tab_contents);
+ // |web_contents| (used by ui tests).
+ static InterstitialPage* GetInterstitialPage(
+ content::WebContents* web_contents);
// Sub-classes should return the HTML that should be displayed in the page.
virtual std::string GetHTMLContents();
@@ -148,7 +152,7 @@ class CONTENT_EXPORT InterstitialPage : public content::NotificationObserver,
virtual void UpdateEntry(content::NavigationEntry* entry) {}
bool enabled() const { return enabled_; }
- TabContents* tab() const { return tab_; }
+ content::WebContents* tab() const;
const GURL& url() const { return url_; }
RenderViewHost* render_view_host() const { return render_view_host_; }
void set_renderer_preferences(const content::RendererPreferences& prefs) {