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

Unified Diff: chrome/browser/chromeos/gview_request_interceptor.cc

Issue 7019030: Remove ProtocolFactory/Interceptor uses in GViewRequestInterceptor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix release. Created 9 years, 7 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/chromeos/gview_request_interceptor.cc
diff --git a/chrome/browser/chromeos/gview_request_interceptor.cc b/chrome/browser/chromeos/gview_request_interceptor.cc
index 7f23708c6ceac7f58950b9e59515ad1e9c1bae2d..fe98c15b9fbe850afcd107783366d4b333d1950a 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
« no previous file with comments | « chrome/browser/chromeos/gview_request_interceptor.h ('k') | chrome/browser/chromeos/gview_request_interceptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698