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

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

Issue 258373002: Towards moving guest management to chrome: Introduce GuestViewManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with ToT Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/shell_content_browser_client.h" 5 #include "content/shell/browser/shell_content_browser_client.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "content/public/browser/render_process_host.h" 13 #include "content/public/browser/render_process_host.h"
14 #include "content/public/browser/resource_dispatcher_host.h" 14 #include "content/public/browser/resource_dispatcher_host.h"
15 #include "content/public/browser/storage_partition.h" 15 #include "content/public/browser/storage_partition.h"
16 #include "content/public/common/content_switches.h" 16 #include "content/public/common/content_switches.h"
17 #include "content/public/common/url_constants.h" 17 #include "content/public/common/url_constants.h"
18 #include "content/shell/browser/browser_plugin/test_guest_manager_delegate.h"
18 #include "content/shell/browser/shell.h" 19 #include "content/shell/browser/shell.h"
19 #include "content/shell/browser/shell_browser_context.h" 20 #include "content/shell/browser/shell_browser_context.h"
20 #include "content/shell/browser/shell_browser_main_parts.h" 21 #include "content/shell/browser/shell_browser_main_parts.h"
21 #include "content/shell/browser/shell_devtools_delegate.h" 22 #include "content/shell/browser/shell_devtools_delegate.h"
22 #include "content/shell/browser/shell_message_filter.h" 23 #include "content/shell/browser/shell_message_filter.h"
23 #include "content/shell/browser/shell_net_log.h" 24 #include "content/shell/browser/shell_net_log.h"
24 #include "content/shell/browser/shell_quota_permission_context.h" 25 #include "content/shell/browser/shell_quota_permission_context.h"
25 #include "content/shell/browser/shell_resource_dispatcher_host_delegate.h" 26 #include "content/shell/browser/shell_resource_dispatcher_host_delegate.h"
26 #include "content/shell/browser/shell_web_contents_view_delegate_creator.h" 27 #include "content/shell/browser/shell_web_contents_view_delegate_creator.h"
27 #include "content/shell/browser/webkit_test_controller.h" 28 #include "content/shell/browser/webkit_test_controller.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 ShellContentBrowserClient::~ShellContentBrowserClient() { 138 ShellContentBrowserClient::~ShellContentBrowserClient() {
138 g_browser_client = NULL; 139 g_browser_client = NULL;
139 } 140 }
140 141
141 BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( 142 BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts(
142 const MainFunctionParams& parameters) { 143 const MainFunctionParams& parameters) {
143 shell_browser_main_parts_ = new ShellBrowserMainParts(parameters); 144 shell_browser_main_parts_ = new ShellBrowserMainParts(parameters);
144 return shell_browser_main_parts_; 145 return shell_browser_main_parts_;
145 } 146 }
146 147
148 BrowserPluginGuestManagerDelegate*
149 ShellContentBrowserClient::GetGuestManagerDelegate(
150 BrowserContext* context) {
151 return TestGuestManagerDelegate::GetInstance();
152 }
153
147 void ShellContentBrowserClient::RenderProcessWillLaunch( 154 void ShellContentBrowserClient::RenderProcessWillLaunch(
148 RenderProcessHost* host) { 155 RenderProcessHost* host) {
149 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 156 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
150 return; 157 return;
151 host->AddFilter(new ShellMessageFilter( 158 host->AddFilter(new ShellMessageFilter(
152 host->GetID(), 159 host->GetID(),
153 BrowserContext::GetDefaultStoragePartition(browser_context()) 160 BrowserContext::GetDefaultStoragePartition(browser_context())
154 ->GetDatabaseTracker(), 161 ->GetDatabaseTracker(),
155 BrowserContext::GetDefaultStoragePartition(browser_context()) 162 BrowserContext::GetDefaultStoragePartition(browser_context())
156 ->GetQuotaManager(), 163 ->GetQuotaManager(),
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 ShellBrowserContext* 373 ShellBrowserContext*
367 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( 374 ShellContentBrowserClient::ShellBrowserContextForBrowserContext(
368 BrowserContext* content_browser_context) { 375 BrowserContext* content_browser_context) {
369 if (content_browser_context == browser_context()) 376 if (content_browser_context == browser_context())
370 return browser_context(); 377 return browser_context();
371 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); 378 DCHECK_EQ(content_browser_context, off_the_record_browser_context());
372 return off_the_record_browser_context(); 379 return off_the_record_browser_context();
373 } 380 }
374 381
375 } // namespace content 382 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698