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

Side by Side Diff: content/shell/shell_content_browser_client.cc

Issue 12518033: Browser Plugin: Only install BrowserPluginMessageFilter if render process supports BrowserPlugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 9 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 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 "content/shell/shell_content_browser_client.h" 5 #include "content/shell/shell_content_browser_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
11 #include "content/public/browser/resource_dispatcher_host.h" 11 #include "content/public/browser/resource_dispatcher_host.h"
12 #include "content/public/browser/storage_partition.h" 12 #include "content/public/browser/storage_partition.h"
13 #include "content/public/common/content_switches.h"
13 #include "content/shell/geolocation/shell_access_token_store.h" 14 #include "content/shell/geolocation/shell_access_token_store.h"
14 #include "content/shell/shell.h" 15 #include "content/shell/shell.h"
15 #include "content/shell/shell_browser_context.h" 16 #include "content/shell/shell_browser_context.h"
16 #include "content/shell/shell_browser_main_parts.h" 17 #include "content/shell/shell_browser_main_parts.h"
17 #include "content/shell/shell_devtools_delegate.h" 18 #include "content/shell/shell_devtools_delegate.h"
18 #include "content/shell/shell_message_filter.h" 19 #include "content/shell/shell_message_filter.h"
19 #include "content/shell/shell_messages.h" 20 #include "content/shell/shell_messages.h"
20 #include "content/shell/shell_resource_dispatcher_host_delegate.h" 21 #include "content/shell/shell_resource_dispatcher_host_delegate.h"
21 #include "content/shell/shell_switches.h" 22 #include "content/shell/shell_switches.h"
22 #include "content/shell/shell_web_contents_view_delegate_creator.h" 23 #include "content/shell/shell_web_contents_view_delegate_creator.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 resource_dispatcher_host_delegate_.reset( 154 resource_dispatcher_host_delegate_.reset(
154 new ShellResourceDispatcherHostDelegate()); 155 new ShellResourceDispatcherHostDelegate());
155 ResourceDispatcherHost::Get()->SetDelegate( 156 ResourceDispatcherHost::Get()->SetDelegate(
156 resource_dispatcher_host_delegate_.get()); 157 resource_dispatcher_host_delegate_.get());
157 } 158 }
158 159
159 std::string ShellContentBrowserClient::GetDefaultDownloadName() { 160 std::string ShellContentBrowserClient::GetDefaultDownloadName() {
160 return "download"; 161 return "download";
161 } 162 }
162 163
164 bool ShellContentBrowserClient::SupportsBrowserPlugin(
165 content::BrowserContext* browser_context, const GURL& url) {
166 return CommandLine::ForCurrentProcess()->HasSwitch(
167 switches::kEnableBrowserPluginForAllViewTypes);
168 }
169
163 WebContentsViewDelegate* ShellContentBrowserClient::GetWebContentsViewDelegate( 170 WebContentsViewDelegate* ShellContentBrowserClient::GetWebContentsViewDelegate(
164 WebContents* web_contents) { 171 WebContents* web_contents) {
165 #if !defined(USE_AURA) 172 #if !defined(USE_AURA)
166 return CreateShellWebContentsViewDelegate(web_contents); 173 return CreateShellWebContentsViewDelegate(web_contents);
167 #else 174 #else
168 return NULL; 175 return NULL;
169 #endif 176 #endif
170 } 177 }
171 178
172 #if defined(OS_ANDROID) 179 #if defined(OS_ANDROID)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 ShellBrowserContext* 216 ShellBrowserContext*
210 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( 217 ShellContentBrowserClient::ShellBrowserContextForBrowserContext(
211 BrowserContext* content_browser_context) { 218 BrowserContext* content_browser_context) {
212 if (content_browser_context == browser_context()) 219 if (content_browser_context == browser_context())
213 return browser_context(); 220 return browser_context();
214 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); 221 DCHECK_EQ(content_browser_context, off_the_record_browser_context());
215 return off_the_record_browser_context(); 222 return off_the_record_browser_context();
216 } 223 }
217 224
218 } // namespace content 225 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698