OLD | NEW |
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/public/common/content_switches.h" |
14 #include "content/shell/geolocation/shell_access_token_store.h" | 14 #include "content/shell/geolocation/shell_access_token_store.h" |
15 #include "content/shell/shell.h" | 15 #include "content/shell/shell.h" |
16 #include "content/shell/shell_browser_context.h" | 16 #include "content/shell/shell_browser_context.h" |
17 #include "content/shell/shell_browser_main_parts.h" | 17 #include "content/shell/shell_browser_main_parts.h" |
18 #include "content/shell/shell_devtools_delegate.h" | 18 #include "content/shell/shell_devtools_delegate.h" |
19 #include "content/shell/shell_message_filter.h" | 19 #include "content/shell/shell_message_filter.h" |
20 #include "content/shell/shell_messages.h" | 20 #include "content/shell/shell_messages.h" |
| 21 #include "content/shell/shell_quota_permission_context.h" |
21 #include "content/shell/shell_resource_dispatcher_host_delegate.h" | 22 #include "content/shell/shell_resource_dispatcher_host_delegate.h" |
22 #include "content/shell/shell_switches.h" | 23 #include "content/shell/shell_switches.h" |
23 #include "content/shell/shell_web_contents_view_delegate_creator.h" | 24 #include "content/shell/shell_web_contents_view_delegate_creator.h" |
24 #include "content/shell/webkit_test_controller.h" | 25 #include "content/shell/webkit_test_controller.h" |
25 #include "googleurl/src/gurl.h" | 26 #include "googleurl/src/gurl.h" |
26 #include "webkit/glue/webpreferences.h" | 27 #include "webkit/glue/webpreferences.h" |
27 | 28 |
28 #if defined(OS_ANDROID) | 29 #if defined(OS_ANDROID) |
29 #include "base/android/path_utils.h" | 30 #include "base/android/path_utils.h" |
30 #include "base/path_service.h" | 31 #include "base/path_service.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 170 |
170 WebContentsViewDelegate* ShellContentBrowserClient::GetWebContentsViewDelegate( | 171 WebContentsViewDelegate* ShellContentBrowserClient::GetWebContentsViewDelegate( |
171 WebContents* web_contents) { | 172 WebContents* web_contents) { |
172 #if !defined(USE_AURA) | 173 #if !defined(USE_AURA) |
173 return CreateShellWebContentsViewDelegate(web_contents); | 174 return CreateShellWebContentsViewDelegate(web_contents); |
174 #else | 175 #else |
175 return NULL; | 176 return NULL; |
176 #endif | 177 #endif |
177 } | 178 } |
178 | 179 |
| 180 QuotaPermissionContext* |
| 181 ShellContentBrowserClient::CreateQuotaPermissionContext() { |
| 182 return new ShellQuotaPermissionContext(); |
| 183 } |
| 184 |
179 #if defined(OS_ANDROID) | 185 #if defined(OS_ANDROID) |
180 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 186 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
181 const CommandLine& command_line, | 187 const CommandLine& command_line, |
182 int child_process_id, | 188 int child_process_id, |
183 std::vector<content::FileDescriptorInfo>* mappings) { | 189 std::vector<content::FileDescriptorInfo>* mappings) { |
184 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; | 190 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; |
185 base::FilePath pak_file; | 191 base::FilePath pak_file; |
186 bool r = PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file); | 192 bool r = PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file); |
187 CHECK(r); | 193 CHECK(r); |
188 pak_file = pak_file.Append(FILE_PATH_LITERAL("paks")); | 194 pak_file = pak_file.Append(FILE_PATH_LITERAL("paks")); |
(...skipping 27 matching lines...) Expand all Loading... |
216 ShellBrowserContext* | 222 ShellBrowserContext* |
217 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 223 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
218 BrowserContext* content_browser_context) { | 224 BrowserContext* content_browser_context) { |
219 if (content_browser_context == browser_context()) | 225 if (content_browser_context == browser_context()) |
220 return browser_context(); | 226 return browser_context(); |
221 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 227 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
222 return off_the_record_browser_context(); | 228 return off_the_record_browser_context(); |
223 } | 229 } |
224 | 230 |
225 } // namespace content | 231 } // namespace content |
OLD | NEW |