summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 15:21:00 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 15:21:00 +0000
commit300e4ea2cb2bfdb316cc0670cc1de8bffffe9d85 (patch)
tree7b3de1bfb311d708eef0aa74841640dde525ef6c /chrome/browser/search_engines
parentac5c06ec27c40539d4b8c3892def9400af2e3852 (diff)
downloadchromium_src-300e4ea2cb2bfdb316cc0670cc1de8bffffe9d85.zip
chromium_src-300e4ea2cb2bfdb316cc0670cc1de8bffffe9d85.tar.gz
chromium_src-300e4ea2cb2bfdb316cc0670cc1de8bffffe9d85.tar.bz2
Allow for non-HTTP schemes in URLs to OSDD entries.
BUG=45203 TEST=as described in the bug Review URL: http://codereview.chromium.org/2265003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r--chrome/browser/search_engines/template_url_fetcher.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/search_engines/template_url_fetcher.cc b/chrome/browser/search_engines/template_url_fetcher.cc
index fe80f09..cffc48e 100644
--- a/chrome/browser/search_engines/template_url_fetcher.cc
+++ b/chrome/browser/search_engines/template_url_fetcher.cc
@@ -16,6 +16,7 @@
#include "chrome/common/notification_registrar.h"
#include "chrome/common/notification_source.h"
#include "chrome/common/notification_type.h"
+#include "net/url_request/url_request_status.h"
// RequestDelegate ------------------------------------------------------------
class TemplateURLFetcher::RequestDelegate : public URLFetcher::Delegate,
@@ -93,8 +94,12 @@ void TemplateURLFetcher::RequestDelegate::OnURLFetchComplete(
int response_code,
const ResponseCookies& cookies,
const std::string& data) {
- // Make sure we can still replace the keyword.
- if (response_code != 200) {
+ // Make sure we can still replace the keyword, i.e. the fetch was successful.
+ // If the OSDD file was loaded HTTP, we also have to check the response_code.
+ // For other schemes, e.g. when the OSDD file is bundled with an extension,
+ // the response_code is not applicable and should be -1.
+ if (!status.is_success() ||
+ ((response_code != -1) && (response_code != 200))) {
fetcher_->RequestCompleted(this);
// WARNING: RequestCompleted deletes us.
return;