| 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 #ifndef CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| 6 #define CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ | 6 #define CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "content/public/browser/content_browser_client.h" | 13 #include "content/public/browser/content_browser_client.h" |
| 14 #include "content/shell/browser/shell_speech_recognition_manager_delegate.h" | 14 #include "content/shell/browser/shell_speech_recognition_manager_delegate.h" |
| 15 #include "gin/v8_initializer.h" |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 | 18 |
| 18 class ShellBrowserContext; | 19 class ShellBrowserContext; |
| 19 class ShellBrowserMainParts; | 20 class ShellBrowserMainParts; |
| 20 class ShellResourceDispatcherHostDelegate; | 21 class ShellResourceDispatcherHostDelegate; |
| 21 | 22 |
| 22 class ShellContentBrowserClient : public ContentBrowserClient { | 23 class ShellContentBrowserClient : public ContentBrowserClient { |
| 23 public: | 24 public: |
| 24 // Gets the current instance. | 25 // Gets the current instance. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 DevToolsManagerDelegate* GetDevToolsManagerDelegate() override; | 69 DevToolsManagerDelegate* GetDevToolsManagerDelegate() override; |
| 69 | 70 |
| 70 void OpenURL(BrowserContext* browser_context, | 71 void OpenURL(BrowserContext* browser_context, |
| 71 const OpenURLParams& params, | 72 const OpenURLParams& params, |
| 72 const base::Callback<void(WebContents*)>& callback) override; | 73 const base::Callback<void(WebContents*)>& callback) override; |
| 73 | 74 |
| 74 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 75 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 75 void GetAdditionalMappedFilesForChildProcess( | 76 void GetAdditionalMappedFilesForChildProcess( |
| 76 const base::CommandLine& command_line, | 77 const base::CommandLine& command_line, |
| 77 int child_process_id, | 78 int child_process_id, |
| 78 FileDescriptorInfo* mappings) override; | 79 content::FileDescriptorInfo* mappings |
| 80 #if defined(OS_ANDROID) |
| 81 , std::map<int, base::MemoryMappedFile::Region>* regions |
| 82 #endif |
| 83 ) override; |
| 79 #endif | 84 #endif |
| 80 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
| 81 void PreSpawnRenderer(sandbox::TargetPolicy* policy, bool* success) override; | 86 void PreSpawnRenderer(sandbox::TargetPolicy* policy, bool* success) override; |
| 82 #endif | 87 #endif |
| 83 | 88 |
| 84 ShellBrowserContext* browser_context(); | 89 ShellBrowserContext* browser_context(); |
| 85 ShellBrowserContext* off_the_record_browser_context(); | 90 ShellBrowserContext* off_the_record_browser_context(); |
| 86 ShellResourceDispatcherHostDelegate* resource_dispatcher_host_delegate() { | 91 ShellResourceDispatcherHostDelegate* resource_dispatcher_host_delegate() { |
| 87 return resource_dispatcher_host_delegate_.get(); | 92 return resource_dispatcher_host_delegate_.get(); |
| 88 } | 93 } |
| 89 ShellBrowserMainParts* shell_browser_main_parts() { | 94 ShellBrowserMainParts* shell_browser_main_parts() { |
| 90 return shell_browser_main_parts_; | 95 return shell_browser_main_parts_; |
| 91 } | 96 } |
| 92 | 97 |
| 93 // Used for content_browsertests. | 98 // Used for content_browsertests. |
| 94 void set_select_client_certificate_callback( | 99 void set_select_client_certificate_callback( |
| 95 base::Closure select_client_certificate_callback) { | 100 base::Closure select_client_certificate_callback) { |
| 96 select_client_certificate_callback_ = select_client_certificate_callback; | 101 select_client_certificate_callback_ = select_client_certificate_callback; |
| 97 } | 102 } |
| 98 | 103 |
| 99 private: | 104 private: |
| 105 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 106 void LazyPrepV8StartupData(); |
| 107 #endif |
| 100 ShellBrowserContext* ShellBrowserContextForBrowserContext( | 108 ShellBrowserContext* ShellBrowserContextForBrowserContext( |
| 101 BrowserContext* content_browser_context); | 109 BrowserContext* content_browser_context); |
| 102 | 110 |
| 103 scoped_ptr<ShellResourceDispatcherHostDelegate> | 111 scoped_ptr<ShellResourceDispatcherHostDelegate> |
| 104 resource_dispatcher_host_delegate_; | 112 resource_dispatcher_host_delegate_; |
| 105 | 113 |
| 106 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 114 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 107 base::ScopedFD v8_natives_fd_; | 115 gin::V8Initializer::V8Files v8_files_; |
| 108 base::ScopedFD v8_snapshot_fd_; | |
| 109 #endif | 116 #endif |
| 110 | 117 |
| 111 base::Closure select_client_certificate_callback_; | 118 base::Closure select_client_certificate_callback_; |
| 112 | 119 |
| 113 ShellBrowserMainParts* shell_browser_main_parts_; | 120 ShellBrowserMainParts* shell_browser_main_parts_; |
| 114 }; | 121 }; |
| 115 | 122 |
| 116 } // namespace content | 123 } // namespace content |
| 117 | 124 |
| 118 #endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ | 125 #endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| OLD | NEW |