| 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 22 matching lines...) Expand all Loading... |
| 33 #include "chrome/browser/extensions/extension_process_manager.h" | 33 #include "chrome/browser/extensions/extension_process_manager.h" |
| 34 #include "chrome/browser/extensions/extension_service.h" | 34 #include "chrome/browser/extensions/extension_service.h" |
| 35 #include "chrome/browser/extensions/extension_system.h" | 35 #include "chrome/browser/extensions/extension_system.h" |
| 36 #include "chrome/browser/extensions/extension_web_ui.h" | 36 #include "chrome/browser/extensions/extension_web_ui.h" |
| 37 #include "chrome/browser/extensions/extension_webkit_preferences.h" | 37 #include "chrome/browser/extensions/extension_webkit_preferences.h" |
| 38 #include "chrome/browser/geolocation/chrome_access_token_store.h" | 38 #include "chrome/browser/geolocation/chrome_access_token_store.h" |
| 39 #include "chrome/browser/google/google_util.h" | 39 #include "chrome/browser/google/google_util.h" |
| 40 #include "chrome/browser/gpu_util.h" | 40 #include "chrome/browser/gpu_util.h" |
| 41 #include "chrome/browser/infobars/infobar_tab_helper.h" | 41 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 42 #include "chrome/browser/media/media_internals.h" | 42 #include "chrome/browser/media/media_internals.h" |
| 43 #include "chrome/browser/media/media_stream_devices_controller.h" |
| 43 #include "chrome/browser/net/chrome_net_log.h" | 44 #include "chrome/browser/net/chrome_net_log.h" |
| 44 #include "chrome/browser/notifications/desktop_notification_service.h" | 45 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 45 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 46 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 46 #include "chrome/browser/pepper_gtalk_message_filter.h" | 47 #include "chrome/browser/pepper_gtalk_message_filter.h" |
| 47 #include "chrome/browser/platform_util.h" | 48 #include "chrome/browser/platform_util.h" |
| 48 #include "chrome/browser/prefs/pref_service.h" | 49 #include "chrome/browser/prefs/pref_service.h" |
| 49 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 50 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 50 #include "chrome/browser/prerender/prerender_manager.h" | 51 #include "chrome/browser/prerender/prerender_manager.h" |
| 51 #include "chrome/browser/prerender/prerender_manager_factory.h" | 52 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 52 #include "chrome/browser/prerender/prerender_message_filter.h" | 53 #include "chrome/browser/prerender/prerender_message_filter.h" |
| (...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 // Abort, if the tab was closed after the request was made but before we | 1112 // Abort, if the tab was closed after the request was made but before we |
| 1112 // got to this point. | 1113 // got to this point. |
| 1113 callback.Run(content::MediaStreamDevices()); | 1114 callback.Run(content::MediaStreamDevices()); |
| 1114 return; | 1115 return; |
| 1115 } | 1116 } |
| 1116 | 1117 |
| 1117 TabContentsWrapper* tab = | 1118 TabContentsWrapper* tab = |
| 1118 TabContentsWrapper::GetCurrentWrapperForContents(contents); | 1119 TabContentsWrapper::GetCurrentWrapperForContents(contents); |
| 1119 DCHECK(tab); | 1120 DCHECK(tab); |
| 1120 | 1121 |
| 1121 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); | 1122 scoped_ptr<MediaStreamDevicesController> |
| 1122 InfoBarDelegate* old_infobar = NULL; | 1123 controller(new MediaStreamDevicesController(tab->profile(), |
| 1123 for (size_t i = 0; i < infobar_helper->infobar_count() && !old_infobar; ++i) { | 1124 request, |
| 1124 old_infobar = | 1125 callback)); |
| 1125 infobar_helper->GetInfoBarDelegateAt(i)->AsMediaStreamInfoBarDelegate(); | 1126 if (!controller->DismissInfoBarAndTakeActionOnSettings()) { |
| 1127 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); |
| 1128 InfoBarDelegate* old_infobar = NULL; |
| 1129 size_t i = 0; |
| 1130 for (; i < infobar_helper->infobar_count() && !old_infobar; ++i) { |
| 1131 old_infobar = infobar_helper->GetInfoBarDelegateAt(i)-> |
| 1132 AsMediaStreamInfoBarDelegate(); |
| 1133 } |
| 1134 |
| 1135 // The MediaStreamInfoBarDelegate will take the ownership of the controller; |
| 1136 MediaStreamInfoBarDelegate* infobar = |
| 1137 new MediaStreamInfoBarDelegate(infobar_helper, |
| 1138 controller.release()); |
| 1139 if (old_infobar) |
| 1140 infobar_helper->ReplaceInfoBar(old_infobar, infobar); |
| 1141 else |
| 1142 infobar_helper->AddInfoBar(infobar); |
| 1126 } | 1143 } |
| 1127 | |
| 1128 InfoBarDelegate* infobar = new MediaStreamInfoBarDelegate(infobar_helper, | |
| 1129 request, | |
| 1130 callback); | |
| 1131 if (old_infobar) | |
| 1132 infobar_helper->ReplaceInfoBar(old_infobar, infobar); | |
| 1133 else | |
| 1134 infobar_helper->AddInfoBar(infobar); | |
| 1135 } | 1144 } |
| 1136 | 1145 |
| 1137 content::MediaObserver* ChromeContentBrowserClient::GetMediaObserver() { | 1146 content::MediaObserver* ChromeContentBrowserClient::GetMediaObserver() { |
| 1138 return MediaInternals::GetInstance(); | 1147 return MediaInternals::GetInstance(); |
| 1139 } | 1148 } |
| 1140 | 1149 |
| 1141 void ChromeContentBrowserClient::RequestDesktopNotificationPermission( | 1150 void ChromeContentBrowserClient::RequestDesktopNotificationPermission( |
| 1142 const GURL& source_origin, | 1151 const GURL& source_origin, |
| 1143 int callback_context, | 1152 int callback_context, |
| 1144 int render_process_id, | 1153 int render_process_id, |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 #if defined(USE_NSS) | 1616 #if defined(USE_NSS) |
| 1608 crypto::CryptoModuleBlockingPasswordDelegate* | 1617 crypto::CryptoModuleBlockingPasswordDelegate* |
| 1609 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1618 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 1610 const GURL& url) { | 1619 const GURL& url) { |
| 1611 return browser::NewCryptoModuleBlockingDialogDelegate( | 1620 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 1612 browser::kCryptoModulePasswordKeygen, url.host()); | 1621 browser::kCryptoModulePasswordKeygen, url.host()); |
| 1613 } | 1622 } |
| 1614 #endif | 1623 #endif |
| 1615 | 1624 |
| 1616 } // namespace chrome | 1625 } // namespace chrome |
| OLD | NEW |