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

Unified Diff: chrome/browser/automation/automation_util.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/automation/automation_util.cc
===================================================================
--- chrome/browser/automation/automation_util.cc (revision 116244)
+++ chrome/browser/automation/automation_util.cc (working copy)
@@ -29,8 +29,8 @@
#include "chrome/common/chrome_view_type.h"
#include "chrome/common/extensions/extension.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/web_contents.h"
#include "net/base/cookie_monster.h"
#include "net/base/cookie_store.h"
#include "net/url_request/url_request_context.h"
@@ -137,21 +137,21 @@
return *(BrowserList::begin() + index);
}
-TabContents* GetTabContentsAt(int browser_index, int tab_index) {
+WebContents* GetWebContentsAt(int browser_index, int tab_index) {
if (tab_index < 0)
return NULL;
Browser* browser = GetBrowserAt(browser_index);
if (!browser || tab_index >= browser->tab_count())
return NULL;
- return browser->GetTabContentsAt(tab_index);
+ return browser->GetWebContentsAt(tab_index);
}
-Browser* GetBrowserForTab(TabContents* tab) {
+Browser* GetBrowserForTab(WebContents* tab) {
BrowserList::const_iterator browser_iter = BrowserList::begin();
for (; browser_iter != BrowserList::end(); ++browser_iter) {
Browser* browser = *browser_iter;
for (int tab_index = 0; tab_index < browser->tab_count(); ++tab_index) {
- if (browser->GetTabContentsAt(tab_index) == tab)
+ if (browser->GetWebContentsAt(tab_index) == tab)
return browser;
}
}
@@ -160,7 +160,7 @@
net::URLRequestContextGetter* GetRequestContext(WebContents* contents) {
// Since we may be on the UI thread don't call GetURLRequestContext().
- // Get the request context specific to the current TabContents and app.
+ // Get the request context specific to the current WebContents and app.
return contents->GetBrowserContext()->GetRequestContextForRenderProcess(
contents->GetRenderProcessHost()->GetID());
}
@@ -438,7 +438,7 @@
return AutomationId(AutomationId::kTypeExtension, extension->id());
}
-bool GetTabForId(const AutomationId& id, TabContents** tab) {
+bool GetTabForId(const AutomationId& id, WebContents** tab) {
if (id.type() != AutomationId::kTypeTab)
return false;
@@ -449,7 +449,7 @@
TabContentsWrapper* wrapper = browser->GetTabContentsWrapperAt(tab_index);
if (base::IntToString(wrapper->restore_tab_helper()->session_id().id()) ==
id.id()) {
- *tab = wrapper->tab_contents();
+ *tab = wrapper->web_contents();
return true;
}
}
@@ -486,7 +486,7 @@
RenderViewHost** rvh) {
switch (id.type()) {
case AutomationId::kTypeTab: {
- TabContents* tab;
+ WebContents* tab;
if (!GetTabForId(id, &tab))
return false;
*rvh = tab->GetRenderViewHost();
@@ -521,7 +521,7 @@
bool DoesObjectWithIdExist(const AutomationId& id, Profile* profile) {
switch (id.type()) {
case AutomationId::kTypeTab: {
- TabContents* tab;
+ WebContents* tab;
return GetTabForId(id, &tab);
}
case AutomationId::kTypeExtensionPopup:
« no previous file with comments | « chrome/browser/automation/automation_util.h ('k') | chrome/browser/automation/testing_automation_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698