| 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" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 const GURL& current_url, | 296 const GURL& current_url, |
| 297 const GURL& new_url) { | 297 const GURL& new_url) { |
| 298 return g_swap_processes_for_redirect; | 298 return g_swap_processes_for_redirect; |
| 299 } | 299 } |
| 300 | 300 |
| 301 DevToolsManagerDelegate* | 301 DevToolsManagerDelegate* |
| 302 ShellContentBrowserClient::GetDevToolsManagerDelegate() { | 302 ShellContentBrowserClient::GetDevToolsManagerDelegate() { |
| 303 return new ShellDevToolsManagerDelegate(browser_context()); | 303 return new ShellDevToolsManagerDelegate(browser_context()); |
| 304 } | 304 } |
| 305 | 305 |
| 306 WebContents* ShellContentBrowserClient::OpenURL(BrowserContext* browser_context, | 306 void ShellContentBrowserClient::OpenURL( |
| 307 const OpenURLParams& params) { | 307 BrowserContext* browser_context, |
| 308 return Shell::CreateNewWindow(browser_context, | 308 const OpenURLParams& params, |
| 309 params.url, | 309 base::Callback<void(WebContents*)> callback) { |
| 310 nullptr, | 310 WebContents* contents = Shell::CreateNewWindow(browser_context, |
| 311 gfx::Size())->web_contents(); | 311 params.url, |
| 312 nullptr, |
| 313 gfx::Size())->web_contents(); |
| 314 callback.Run(contents); |
| 312 } | 315 } |
| 313 | 316 |
| 314 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 317 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 315 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 318 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| 316 const base::CommandLine& command_line, | 319 const base::CommandLine& command_line, |
| 317 int child_process_id, | 320 int child_process_id, |
| 318 FileDescriptorInfo* mappings) { | 321 FileDescriptorInfo* mappings) { |
| 319 #if defined(OS_ANDROID) | 322 #if defined(OS_ANDROID) |
| 320 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; | 323 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; |
| 321 base::FilePath pak_file; | 324 base::FilePath pak_file; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 ShellBrowserContext* | 387 ShellBrowserContext* |
| 385 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 388 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
| 386 BrowserContext* content_browser_context) { | 389 BrowserContext* content_browser_context) { |
| 387 if (content_browser_context == browser_context()) | 390 if (content_browser_context == browser_context()) |
| 388 return browser_context(); | 391 return browser_context(); |
| 389 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 392 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
| 390 return off_the_record_browser_context(); | 393 return off_the_record_browser_context(); |
| 391 } | 394 } |
| 392 | 395 |
| 393 } // namespace content | 396 } // namespace content |
| OLD | NEW |