| 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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 #include "chrome/browser/profiles/profile_manager.h" | 56 #include "chrome/browser/profiles/profile_manager.h" |
| 57 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" | 57 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
| 58 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" | 58 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" |
| 59 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory
.h" | 59 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory
.h" |
| 60 #include "chrome/browser/renderer_host/plugin_info_message_filter.h" | 60 #include "chrome/browser/renderer_host/plugin_info_message_filter.h" |
| 61 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" | 61 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" |
| 62 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" | 62 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" |
| 63 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" | 63 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" |
| 64 #include "chrome/browser/ssl/ssl_add_cert_handler.h" | 64 #include "chrome/browser/ssl/ssl_add_cert_handler.h" |
| 65 #include "chrome/browser/ssl/ssl_blocking_page.h" | 65 #include "chrome/browser/ssl/ssl_blocking_page.h" |
| 66 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" | 66 #include "chrome/browser/ssl/ssl_tab_helper.h" |
| 67 #include "chrome/browser/tab_contents/tab_util.h" | 67 #include "chrome/browser/tab_contents/tab_util.h" |
| 68 #include "chrome/browser/toolkit_extra_parts.h" | 68 #include "chrome/browser/toolkit_extra_parts.h" |
| 69 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 69 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
| 70 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 70 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 71 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 71 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 72 #include "chrome/browser/user_style_sheet_watcher.h" | 72 #include "chrome/browser/user_style_sheet_watcher.h" |
| 73 #include "chrome/browser/user_style_sheet_watcher_factory.h" | 73 #include "chrome/browser/user_style_sheet_watcher_factory.h" |
| 74 #include "chrome/browser/view_type_utils.h" | 74 #include "chrome/browser/view_type_utils.h" |
| 75 #include "chrome/common/child_process_logging.h" | 75 #include "chrome/common/child_process_logging.h" |
| 76 #include "chrome/common/chrome_constants.h" | 76 #include "chrome/common/chrome_constants.h" |
| (...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 // Use the first certificate that is matched by the filter. | 1170 // Use the first certificate that is matched by the filter. |
| 1171 callback.Run(all_client_certs[i]); | 1171 callback.Run(all_client_certs[i]); |
| 1172 return; | 1172 return; |
| 1173 } | 1173 } |
| 1174 } | 1174 } |
| 1175 } else { | 1175 } else { |
| 1176 NOTREACHED(); | 1176 NOTREACHED(); |
| 1177 } | 1177 } |
| 1178 } | 1178 } |
| 1179 | 1179 |
| 1180 TabContents* tab_contents = TabContents::FromWebContents(tab); | 1180 SSLTabHelper* ssl_tab_helper = SSLTabHelper::FromWebContents(tab); |
| 1181 if (!tab_contents) { | 1181 if (!ssl_tab_helper) { |
| 1182 // If there is no TabContents for the given WebContents then we can't | 1182 // If there is no SSLTabHelper for the given WebContents then we can't |
| 1183 // show the user a dialog to select a client certificate. So we simply | 1183 // show the user a dialog to select a client certificate. So we simply |
| 1184 // proceed with no client certificate. | 1184 // proceed with no client certificate. |
| 1185 callback.Run(NULL); | 1185 callback.Run(NULL); |
| 1186 return; | 1186 return; |
| 1187 } | 1187 } |
| 1188 tab_contents->ssl_helper()->ShowClientCertificateRequestDialog( | 1188 ssl_tab_helper->ShowClientCertificateRequestDialog( |
| 1189 network_session, cert_request_info, callback); | 1189 network_session, cert_request_info, callback); |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 void ChromeContentBrowserClient::AddNewCertificate( | 1192 void ChromeContentBrowserClient::AddNewCertificate( |
| 1193 net::URLRequest* request, | 1193 net::URLRequest* request, |
| 1194 net::X509Certificate* cert, | 1194 net::X509Certificate* cert, |
| 1195 int render_process_id, | 1195 int render_process_id, |
| 1196 int render_view_id) { | 1196 int render_view_id) { |
| 1197 // The handler will run the UI and delete itself when it's finished. | 1197 // The handler will run the UI and delete itself when it's finished. |
| 1198 new SSLAddCertHandler(request, cert, render_process_id, render_view_id); | 1198 new SSLAddCertHandler(request, cert, render_process_id, render_view_id); |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1724 partition_id = extension->id(); | 1724 partition_id = extension->id(); |
| 1725 } | 1725 } |
| 1726 | 1726 |
| 1727 // Enforce that IsValidStoragePartitionId() implementation stays in sync. | 1727 // Enforce that IsValidStoragePartitionId() implementation stays in sync. |
| 1728 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 1728 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
| 1729 return partition_id; | 1729 return partition_id; |
| 1730 } | 1730 } |
| 1731 | 1731 |
| 1732 | 1732 |
| 1733 } // namespace chrome | 1733 } // namespace chrome |
| OLD | NEW |