summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/gview_request_interceptor.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos/gview_request_interceptor.h')
-rw-r--r--chrome/browser/chromeos/gview_request_interceptor.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/chrome/browser/chromeos/gview_request_interceptor.h b/chrome/browser/chromeos/gview_request_interceptor.h
index 9fe0139..eee5472 100644
--- a/chrome/browser/chromeos/gview_request_interceptor.h
+++ b/chrome/browser/chromeos/gview_request_interceptor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,9 +8,7 @@
#include <string>
#include "base/hash_tables.h"
-#include "net/url_request/url_request.h"
-
-template <typename T> struct DefaultSingletonTraits;
+#include "net/url_request/url_request_job_factory.h"
namespace chromeos {
@@ -20,26 +18,27 @@ namespace chromeos {
// document types (such as PDF) and redirect the request to the Google
// Document Viewer, including the document's original URL as a
// parameter.
-class GViewRequestInterceptor : public net::URLRequest::Interceptor {
+class GViewRequestInterceptor : public net::URLRequestJobFactory::Interceptor {
public:
+ GViewRequestInterceptor();
+ virtual ~GViewRequestInterceptor();
+
// Always returns NULL because we don't want to attempt a redirect
// before seeing the detected mime type of the request.
- virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request);
+ virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request) const;
+
+ // Always returns NULL.
+ virtual net::URLRequestJob* MaybeInterceptRedirect(
+ const GURL& location,
+ net::URLRequest* request) const;
// Determines if the requested document can be viewed by the Google
// Document Viewer. If it can, returns a net::URLRequestJob that
// redirects the browser to the view URL.
- virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request);
-
- // Singleton accessor.
- static GViewRequestInterceptor* GetInstance();
+ virtual net::URLRequestJob* MaybeInterceptResponse(
+ net::URLRequest* request) const;
private:
- friend struct DefaultSingletonTraits<GViewRequestInterceptor>;
-
- GViewRequestInterceptor();
- virtual ~GViewRequestInterceptor();
-
// The list of supported mime types.
base::hash_set<std::string> supported_mime_types_;
};