diff options
Diffstat (limited to 'chrome/browser/chromeos/gview_request_interceptor.cc')
-rw-r--r-- | chrome/browser/chromeos/gview_request_interceptor.cc | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/chrome/browser/chromeos/gview_request_interceptor.cc b/chrome/browser/chromeos/gview_request_interceptor.cc index 7f23708..fe98c15 100644 --- a/chrome/browser/chromeos/gview_request_interceptor.cc +++ b/chrome/browser/chromeos/gview_request_interceptor.cc @@ -5,14 +5,12 @@ #include "chrome/browser/chromeos/gview_request_interceptor.h" #include "base/file_path.h" -#include "base/memory/singleton.h" #include "base/path_service.h" #include "chrome/common/chrome_paths.h" #include "googleurl/src/gurl.h" #include "net/base/escape.h" #include "net/base/load_flags.h" #include "net/url_request/url_request.h" -#include "net/url_request/url_request_job.h" #include "net/url_request/url_request_redirect_job.h" #include "webkit/glue/plugins/plugin_list.h" @@ -21,37 +19,41 @@ namespace chromeos { // The PDF mime type is treated special if the browser has a built-in // PDF viewer plug-in installed - we want to intercept only if we're // told to. -static const char* const kPdfMimeType = "application/pdf"; +static const char kPdfMimeType[] = "application/pdf"; // This is the list of mime types currently supported by the Google // Document Viewer. -static const char* const supported_mime_type_list[] = { +static const char* const kSupportedMimeTypeList[] = { kPdfMimeType, "application/vnd.ms-powerpoint" }; -static const char* const kGViewUrlPrefix = "http://docs.google.com/gview?url="; +static const char kGViewUrlPrefix[] = "http://docs.google.com/gview?url="; GViewRequestInterceptor::GViewRequestInterceptor() { - net::URLRequest::RegisterRequestInterceptor(this); - for (size_t i = 0; i < arraysize(supported_mime_type_list); ++i) { - supported_mime_types_.insert(supported_mime_type_list[i]); + for (size_t i = 0; i < arraysize(kSupportedMimeTypeList); ++i) { + supported_mime_types_.insert(kSupportedMimeTypeList[i]); } } GViewRequestInterceptor::~GViewRequestInterceptor() { - net::URLRequest::UnregisterRequestInterceptor(this); } net::URLRequestJob* GViewRequestInterceptor::MaybeIntercept( - net::URLRequest* request) { + net::URLRequest* request) const { // Don't attempt to intercept here as we want to wait until the mime // type is fully determined. return NULL; } +net::URLRequestJob* GViewRequestInterceptor::MaybeInterceptRedirect( + const GURL& location, + net::URLRequest* request) const { + return NULL; +} + net::URLRequestJob* GViewRequestInterceptor::MaybeInterceptResponse( - net::URLRequest* request) { + net::URLRequest* request) const { // Do not intercept this request if it is a download. if (request->load_flags() & net::LOAD_IS_DOWNLOAD) { return NULL; @@ -81,8 +83,4 @@ net::URLRequestJob* GViewRequestInterceptor::MaybeInterceptResponse( return NULL; } -GViewRequestInterceptor* GViewRequestInterceptor::GetInstance() { - return Singleton<GViewRequestInterceptor>::get(); -} - } // namespace chromeos |