| 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/permission_type.h" | |
| 16 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
| 17 #include "content/public/browser/resource_dispatcher_host.h" | 16 #include "content/public/browser/resource_dispatcher_host.h" |
| 18 #include "content/public/browser/storage_partition.h" | 17 #include "content/public/browser/storage_partition.h" |
| 19 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 20 #include "content/public/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
| 21 #include "content/public/common/web_preferences.h" | 20 #include "content/public/common/web_preferences.h" |
| 22 #include "content/shell/browser/ipc_echo_message_filter.h" | 21 #include "content/shell/browser/ipc_echo_message_filter.h" |
| 23 #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h" | 22 #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" | 23 #include "content/shell/browser/layout_test/layout_test_resource_dispatcher_host
_delegate.h" |
| 25 #include "content/shell/browser/shell.h" | 24 #include "content/shell/browser/shell.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 289 } |
| 291 | 290 |
| 292 void ShellContentBrowserClient::SelectClientCertificate( | 291 void ShellContentBrowserClient::SelectClientCertificate( |
| 293 WebContents* web_contents, | 292 WebContents* web_contents, |
| 294 net::SSLCertRequestInfo* cert_request_info, | 293 net::SSLCertRequestInfo* cert_request_info, |
| 295 scoped_ptr<ClientCertificateDelegate> delegate) { | 294 scoped_ptr<ClientCertificateDelegate> delegate) { |
| 296 if (!select_client_certificate_callback_.is_null()) | 295 if (!select_client_certificate_callback_.is_null()) |
| 297 select_client_certificate_callback_.Run(); | 296 select_client_certificate_callback_.Run(); |
| 298 } | 297 } |
| 299 | 298 |
| 300 void ShellContentBrowserClient::RequestPermission( | |
| 301 PermissionType permission, | |
| 302 WebContents* web_contents, | |
| 303 int bridge_id, | |
| 304 const GURL& requesting_frame, | |
| 305 bool user_gesture, | |
| 306 const base::Callback<void(PermissionStatus)>& callback) { | |
| 307 // Some Geolocation tests on Android are still expecting to have the | |
| 308 // permission granted. See https://crbug.com/463514. | |
| 309 if (permission == PermissionType::GEOLOCATION) { | |
| 310 callback.Run(PERMISSION_STATUS_GRANTED); | |
| 311 return; | |
| 312 } | |
| 313 | |
| 314 ContentBrowserClient::RequestPermission( | |
| 315 permission, web_contents, bridge_id, | |
| 316 requesting_frame, user_gesture, callback); | |
| 317 } | |
| 318 | |
| 319 SpeechRecognitionManagerDelegate* | 299 SpeechRecognitionManagerDelegate* |
| 320 ShellContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { | 300 ShellContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { |
| 321 return new ShellSpeechRecognitionManagerDelegate(); | 301 return new ShellSpeechRecognitionManagerDelegate(); |
| 322 } | 302 } |
| 323 | 303 |
| 324 net::NetLog* ShellContentBrowserClient::GetNetLog() { | 304 net::NetLog* ShellContentBrowserClient::GetNetLog() { |
| 325 return shell_browser_main_parts_->net_log(); | 305 return shell_browser_main_parts_->net_log(); |
| 326 } | 306 } |
| 327 | 307 |
| 328 bool ShellContentBrowserClient::ShouldSwapProcessesForRedirect( | 308 bool ShellContentBrowserClient::ShouldSwapProcessesForRedirect( |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 ShellBrowserContext* | 422 ShellBrowserContext* |
| 443 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 423 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
| 444 BrowserContext* content_browser_context) { | 424 BrowserContext* content_browser_context) { |
| 445 if (content_browser_context == browser_context()) | 425 if (content_browser_context == browser_context()) |
| 446 return browser_context(); | 426 return browser_context(); |
| 447 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 427 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
| 448 return off_the_record_browser_context(); | 428 return off_the_record_browser_context(); |
| 449 } | 429 } |
| 450 | 430 |
| 451 } // namespace content | 431 } // namespace content |
| OLD | NEW |