diff options
Diffstat (limited to 'chrome/browser/safe_browsing/malware_details.cc')
| -rw-r--r-- | chrome/browser/safe_browsing/malware_details.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/chrome/browser/safe_browsing/malware_details.cc b/chrome/browser/safe_browsing/malware_details.cc index 983c1d9..4a34844 100644 --- a/chrome/browser/safe_browsing/malware_details.cc +++ b/chrome/browser/safe_browsing/malware_details.cc @@ -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 @@ class MalwareDetailsFactoryImpl 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 base::LazyInstance<MalwareDetailsFactoryImpl> /* 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 @@ void MalwareDetails::StartCollection() { 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 @@ void MalwareDetails::StartCollection() { // 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())); } |
