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

Unified Diff: chrome/browser/ui/search_engines/search_engine_tab_helper.cc

Issue 371333003: No content dependencies in TemplateURLFetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/search_engines/search_engine_tab_helper.cc
diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
index 17b1cf7d71731db8cf9a424253c729ab2a4a7bef..c234db342a1d373ac6adeb518fa999d9a08172b8 100644
--- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
+++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
@@ -16,8 +16,11 @@
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/frame_navigate_params.h"
+#include "content/public/common/url_fetcher.h"
using content::NavigationController;
using content::NavigationEntry;
@@ -61,6 +64,15 @@ base::string16 GenerateKeywordFromNavigationEntry(
return TemplateURL::GenerateKeyword(url);
}
+void AssociateURLFetcherWithWebContents(content::WebContents* web_contents,
+ net::URLFetcher* url_fetcher) {
+ content::AssociateURLFetcherWithRenderFrame(
+ url_fetcher,
+ web_contents->GetURL(),
+ web_contents->GetRenderProcessHost()->GetID(),
+ web_contents->GetMainFrame()->GetRoutingID());
+}
+
} // namespace
SearchEngineTabHelper::~SearchEngineTabHelper() {
@@ -134,7 +146,8 @@ void SearchEngineTabHelper::OnPageHasOSDD(
// Download the OpenSearch description document. If this is successful, a
// new keyword will be created when done.
TemplateURLFetcherFactory::GetForProfile(profile)->ScheduleDownload(
- keyword, osdd_url, entry->GetFavicon().url, web_contents(),
+ keyword, osdd_url, entry->GetFavicon().url,
+ base::Bind(&AssociateURLFetcherWithWebContents, web_contents()),
base::Bind(&SearchEngineTabHelper::OnDownloadedOSDD,
weak_ptr_factory_.GetWeakPtr()),
provider_type);

Powered by Google App Engine
This is Rietveld 408576698