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

Unified Diff: chrome/browser/safe_browsing/malware_details.cc

Issue 9030010: Move most of the remaining users of WebContentsObserver::tab_contents() to use web_contents(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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/safe_browsing/malware_details.cc
===================================================================
--- chrome/browser/safe_browsing/malware_details.cc (revision 115777)
+++ chrome/browser/safe_browsing/malware_details.cc (working copy)
@@ -17,13 +17,14 @@
#include "chrome/common/safe_browsing/safebrowsing_messages.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/navigation_entry.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/io_buffer.h"
#include "net/disk_cache/disk_cache.h"
#include "net/url_request/url_request_context_getter.h"
using content::BrowserThread;
+using content::WebContents;
using safe_browsing::ClientMalwareReportRequest;
// Keep in sync with KMaxNodes in renderer/safe_browsing/malware_dom_details
@@ -39,9 +40,9 @@
public:
MalwareDetails* CreateMalwareDetails(
SafeBrowsingService* sb_service,
- TabContents* tab_contents,
+ WebContents* web_contents,
const SafeBrowsingService::UnsafeResource& unsafe_resource) {
- return new MalwareDetails(sb_service, tab_contents, unsafe_resource);
+ return new MalwareDetails(sb_service, web_contents, unsafe_resource);
}
private:
@@ -60,22 +61,22 @@
/* static */
MalwareDetails* MalwareDetails::NewMalwareDetails(
SafeBrowsingService* sb_service,
- TabContents* tab_contents,
+ WebContents* web_contents,
const SafeBrowsingService::UnsafeResource& resource) {
// Set up the factory if this has not been done already (tests do that
// before this method is called).
if (!factory_)
factory_ = g_malware_details_factory_impl.Pointer();
- return factory_->CreateMalwareDetails(sb_service, tab_contents, resource);
+ return factory_->CreateMalwareDetails(sb_service, web_contents, resource);
}
// Create a MalwareDetails for the given tab. Runs in the UI thread.
MalwareDetails::MalwareDetails(
SafeBrowsingService* sb_service,
- TabContents* tab_contents,
+ content::WebContents* web_contents,
const SafeBrowsingService::UnsafeResource& resource)
- : content::WebContentsObserver(tab_contents),
- profile_(Profile::FromBrowserContext(tab_contents->GetBrowserContext())),
+ : content::WebContentsObserver(web_contents),
+ profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())),
request_context_getter_(profile_->GetRequestContext()),
sb_service_(sb_service),
resource_(resource),
@@ -161,13 +162,13 @@
report_->set_malware_url(resource_.url.spec());
}
- GURL page_url = tab_contents()->GetURL();
+ GURL page_url = web_contents()->GetURL();
if (IsPublicUrl(page_url)) {
report_->set_page_url(page_url.spec());
}
GURL referrer_url;
- NavigationEntry* nav_entry = tab_contents()->GetController().GetActiveEntry();
+ NavigationEntry* nav_entry = web_contents()->GetController().GetActiveEntry();
if (nav_entry) {
referrer_url = nav_entry->GetReferrer().url;
if (IsPublicUrl(referrer_url)) {
@@ -210,7 +211,7 @@
// Get URLs of frames, scripts etc from the DOM.
// OnReceivedMalwareDOMDetails will be called when the renderer replies.
- RenderViewHost* view = tab_contents()->GetRenderViewHost();
+ RenderViewHost* view = web_contents()->GetRenderViewHost();
view->Send(new SafeBrowsingMsg_GetMalwareDOMDetails(view->routing_id()));
}
« no previous file with comments | « chrome/browser/safe_browsing/malware_details.h ('k') | chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698