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

Unified Diff: chrome/browser/ui/browser_navigator.cc

Issue 9085006: Replace Browser::GetTabContentsAt with GetWebContentsAt and update all callers. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac yet again Created 8 years, 12 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/browser_navigator.cc
===================================================================
--- chrome/browser/ui/browser_navigator.cc (revision 116244)
+++ chrome/browser/ui/browser_navigator.cc (working copy)
@@ -30,9 +30,11 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/browser/browser_url_handler.h"
+#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/site_instance.h"
-#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/web_contents.h"
#include "net/http/http_util.h"
using content::GlobalRequestID;
@@ -245,7 +247,7 @@
return params->browser->profile();
}
-void LoadURLInContents(TabContents* target_contents,
+void LoadURLInContents(WebContents* target_contents,
const GURL& url,
browser::NavigateParams* params,
const std::string& extra_headers) {
@@ -483,8 +485,8 @@
}
if (params->disposition != CURRENT_TAB) {
- TabContents* source_contents = params->source_contents ?
- params->source_contents->tab_contents() : NULL;
+ WebContents* source_contents = params->source_contents ?
+ params->source_contents->web_contents() : NULL;
params->target_contents =
Browser::TabContentsFactory(
params->browser->profile(),
@@ -504,7 +506,7 @@
// in the background, tell it that it's hidden.
if ((params->tabstrip_add_types & TabStripModel::ADD_ACTIVE) == 0) {
// TabStripModel::AddTabContents invokes HideContents if not foreground.
- params->target_contents->tab_contents()->WasHidden();
+ params->target_contents->web_contents()->WasHidden();
}
} else {
// ... otherwise if we're loading in the current tab, the target is the
@@ -514,8 +516,8 @@
}
if (user_initiated) {
- static_cast<RenderViewHostDelegate*>(params->target_contents->
- tab_contents())->OnUserGesture();
+ params->target_contents->web_contents()->GetRenderViewHost()->
+ delegate()->OnUserGesture();
}
InitializeExtraHeaders(params, params->target_contents->profile(),
@@ -527,7 +529,7 @@
// Perform the actual navigation, tracking whether it came from the
// renderer.
- LoadURLInContents(params->target_contents->tab_contents(),
+ LoadURLInContents(params->target_contents->web_contents(),
url, params, extra_headers);
}
} else {
@@ -543,7 +545,7 @@
(params->disposition == NEW_FOREGROUND_TAB ||
params->disposition == NEW_WINDOW) &&
(params->tabstrip_add_types & TabStripModel::ADD_INHERIT_OPENER))
- params->source_contents->tab_contents()->Focus();
+ params->source_contents->web_contents()->Focus();
if (params->source_contents == params->target_contents) {
// The navigation occurred in the source tab.
@@ -569,7 +571,7 @@
}
if (singleton_index >= 0) {
- TabContents* target = params->browser->GetTabContentsAt(singleton_index);
+ WebContents* target = params->browser->GetWebContentsAt(singleton_index);
if (target->IsCrashed()) {
target->GetController().Reload(true);
@@ -588,7 +590,7 @@
content::NotificationService::current()->Notify(
content::NOTIFICATION_TAB_ADDED,
content::Source<content::WebContentsDelegate>(params->browser),
- content::Details<WebContents>(params->target_contents->tab_contents()));
+ content::Details<WebContents>(params->target_contents->web_contents()));
}
}
@@ -625,9 +627,9 @@
replacements.ClearQuery();
}
- if (CompareURLsWithReplacements(tab->tab_contents()->GetURL(),
+ if (CompareURLsWithReplacements(tab->web_contents()->GetURL(),
params->url, replacements) ||
- CompareURLsWithReplacements(tab->tab_contents()->GetURL(),
+ CompareURLsWithReplacements(tab->web_contents()->GetURL(),
rewritten_url, replacements)) {
params->target_contents = tab;
return tab_index;
« no previous file with comments | « chrome/browser/ui/browser_init_browsertest.cc ('k') | chrome/browser/ui/browser_tab_restore_service_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698