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

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

Issue 9006036: Create an API around PluginService and use it from Chrome. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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"
11 #include "chrome/common/url_constants.h" 11 #include "chrome/common/url_constants.h"
12 #include "content/browser/plugin_service.h"
13 #include "content/browser/renderer_host/resource_dispatcher_host.h" 12 #include "content/browser/renderer_host/resource_dispatcher_host.h"
14 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" 13 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
14 #include "content/public/browser/plugin_service.h"
15 #include "googleurl/src/gurl.h" 15 #include "googleurl/src/gurl.h"
16 #include "net/base/escape.h" 16 #include "net/base/escape.h"
17 #include "net/base/load_flags.h" 17 #include "net/base/load_flags.h"
18 #include "net/url_request/url_request.h" 18 #include "net/url_request/url_request.h"
19 #include "net/url_request/url_request_redirect_job.h" 19 #include "net/url_request/url_request_redirect_job.h"
20 #include "webkit/plugins/webplugininfo.h" 20 #include "webkit/plugins/webplugininfo.h"
21 21
22 using content::PluginService;
23
22 namespace chromeos { 24 namespace chromeos {
23 25
24 namespace { 26 namespace {
25 27
26 // The PDF mime type is treated special if the browser has a built-in 28 // The PDF mime type is treated special if the browser has a built-in
27 // PDF viewer plug-in installed - we want to intercept only if we're 29 // PDF viewer plug-in installed - we want to intercept only if we're
28 // told to. 30 // told to.
29 const char kPdfMimeType[] = "application/pdf"; 31 const char kPdfMimeType[] = "application/pdf";
30 32
31 // This is the list of mime types currently supported by the Google 33 // This is the list of mime types currently supported by the Google
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // will redirect the browser to this new URL. 112 // will redirect the browser to this new URL.
111 if (supported_mime_types_.count(mime_type) > 0) { 113 if (supported_mime_types_.count(mime_type) > 0) {
112 std::string url(kGViewUrlPrefix); 114 std::string url(kGViewUrlPrefix);
113 url += net::EscapePath(request->url().spec()); 115 url += net::EscapePath(request->url().spec());
114 return new net::URLRequestRedirectJob(request, GURL(url)); 116 return new net::URLRequestRedirectJob(request, GURL(url));
115 } 117 }
116 return NULL; 118 return NULL;
117 } 119 }
118 120
119 } // namespace chromeos 121 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chrome_plugin_service_filter.cc ('k') | chrome/browser/chromeos/gview_request_interceptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698