OLD | NEW |
---|---|
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/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.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/client_certificate_delegate.h" | 13 #include "content/public/browser/client_certificate_delegate.h" |
14 #include "content/public/browser/page_navigator.h" | 14 #include "content/public/browser/page_navigator.h" |
15 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
16 #include "content/public/browser/render_view_host.h" | |
16 #include "content/public/browser/resource_dispatcher_host.h" | 17 #include "content/public/browser/resource_dispatcher_host.h" |
17 #include "content/public/browser/storage_partition.h" | 18 #include "content/public/browser/storage_partition.h" |
19 #include "content/public/common/bindings_policy.h" | |
18 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
19 #include "content/public/common/url_constants.h" | 21 #include "content/public/common/url_constants.h" |
20 #include "content/public/common/web_preferences.h" | 22 #include "content/public/common/web_preferences.h" |
21 #include "content/public/test/test_mojo_app.h" | 23 #include "content/public/test/test_mojo_app.h" |
22 #include "content/shell/browser/blink_test_controller.h" | 24 #include "content/shell/browser/blink_test_controller.h" |
23 #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h" | 25 #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h" |
24 #include "content/shell/browser/layout_test/layout_test_resource_dispatcher_host _delegate.h" | 26 #include "content/shell/browser/layout_test/layout_test_resource_dispatcher_host _delegate.h" |
25 #include "content/shell/browser/shell.h" | 27 #include "content/shell/browser/shell.h" |
26 #include "content/shell/browser/shell_access_token_store.h" | 28 #include "content/shell/browser/shell_access_token_store.h" |
27 #include "content/shell/browser/shell_browser_context.h" | 29 #include "content/shell/browser/shell_browser_context.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 void ShellContentBrowserClient::OpenURL( | 331 void ShellContentBrowserClient::OpenURL( |
330 BrowserContext* browser_context, | 332 BrowserContext* browser_context, |
331 const OpenURLParams& params, | 333 const OpenURLParams& params, |
332 const base::Callback<void(WebContents*)>& callback) { | 334 const base::Callback<void(WebContents*)>& callback) { |
333 callback.Run(Shell::CreateNewWindow(browser_context, | 335 callback.Run(Shell::CreateNewWindow(browser_context, |
334 params.url, | 336 params.url, |
335 nullptr, | 337 nullptr, |
336 gfx::Size())->web_contents()); | 338 gfx::Size())->web_contents()); |
337 } | 339 } |
338 | 340 |
341 int ShellContentBrowserClient::GetDefaultEnabledBindingsForView( | |
342 RenderViewHost* view) { | |
343 if (view->GetProcess()->IsForGuestsOnly()) | |
344 return 0; | |
345 // Allow Mojo EDK usage by default on non-guest frames. | |
346 return BINDINGS_POLICY_MOJO; | |
347 } | |
348 | |
349 | |
Charlie Reis
2016/01/15 01:26:51
nit: Remove extra line.
| |
339 #if defined(OS_ANDROID) | 350 #if defined(OS_ANDROID) |
340 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 351 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
341 const base::CommandLine& command_line, | 352 const base::CommandLine& command_line, |
342 int child_process_id, | 353 int child_process_id, |
343 content::FileDescriptorInfo* mappings, | 354 content::FileDescriptorInfo* mappings, |
344 std::map<int, base::MemoryMappedFile::Region>* regions) { | 355 std::map<int, base::MemoryMappedFile::Region>* regions) { |
345 mappings->Share( | 356 mappings->Share( |
346 kShellPakDescriptor, | 357 kShellPakDescriptor, |
347 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor)); | 358 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor)); |
348 regions->insert(std::make_pair( | 359 regions->insert(std::make_pair( |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
406 ShellBrowserContext* | 417 ShellBrowserContext* |
407 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 418 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
408 BrowserContext* content_browser_context) { | 419 BrowserContext* content_browser_context) { |
409 if (content_browser_context == browser_context()) | 420 if (content_browser_context == browser_context()) |
410 return browser_context(); | 421 return browser_context(); |
411 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 422 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
412 return off_the_record_browser_context(); | 423 return off_the_record_browser_context(); |
413 } | 424 } |
414 | 425 |
415 } // namespace content | 426 } // namespace content |
OLD | NEW |