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

Side by Side Diff: chrome/browser/chromeos/gview_request_interceptor.cc

Issue 11420013: POSTs to HSTS domains are no longer converted to GETs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix breakage Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/gview_request_interceptor.h" 5 #include "chrome/browser/chromeos/gview_request_interceptor.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "chrome/browser/chrome_plugin_service_filter.h" 9 #include "chrome/browser/chrome_plugin_service_filter.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // redirect PDF files to Google Document Viewer. 106 // redirect PDF files to Google Document Viewer.
107 if (mime_type == kPdfMimeType && ShouldUsePdfPlugin(request)) 107 if (mime_type == kPdfMimeType && ShouldUsePdfPlugin(request))
108 return NULL; 108 return NULL;
109 109
110 // If supported, build the URL to the Google Document Viewer 110 // If supported, build the URL to the Google Document Viewer
111 // including the origial document's URL, then create a new job that 111 // including the origial document's URL, then create a new job that
112 // will redirect the browser to this new URL. 112 // will redirect the browser to this new URL.
113 if (supported_mime_types_.count(mime_type) > 0) { 113 if (supported_mime_types_.count(mime_type) > 0) {
114 std::string url(kGViewUrlPrefix); 114 std::string url(kGViewUrlPrefix);
115 url += net::EscapePath(request->url().spec()); 115 url += net::EscapePath(request->url().spec());
116 return new net::URLRequestRedirectJob(request, network_delegate, GURL(url)); 116 return new net::URLRequestRedirectJob(
117 request, network_delegate, GURL(url),
118 net::URLRequestRedirectJob::REDIRECT_302_FOUND);
117 } 119 }
118 return NULL; 120 return NULL;
119 } 121 }
120 122
121 } // namespace chromeos 123 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/custom_handlers/protocol_handler_registry.cc » ('j') | net/url_request/url_request_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698