Chromium Code Reviews| 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 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1093 TabContentsWrapper::GetCurrentWrapperForContents(contents); | 1093 TabContentsWrapper::GetCurrentWrapperForContents(contents); |
| 1094 DCHECK(tab); | 1094 DCHECK(tab); |
| 1095 | 1095 |
| 1096 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); | 1096 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); |
| 1097 InfoBarDelegate* old_infobar = NULL; | 1097 InfoBarDelegate* old_infobar = NULL; |
| 1098 for (size_t i = 0; i < infobar_helper->infobar_count() && !old_infobar; ++i) { | 1098 for (size_t i = 0; i < infobar_helper->infobar_count() && !old_infobar; ++i) { |
| 1099 old_infobar = | 1099 old_infobar = |
| 1100 infobar_helper->GetInfoBarDelegateAt(i)->AsMediaStreamInfobarDelegate(); | 1100 infobar_helper->GetInfoBarDelegateAt(i)->AsMediaStreamInfobarDelegate(); |
| 1101 } | 1101 } |
| 1102 | 1102 |
| 1103 #if defined(TOOLKIT_VIEWS) | 1103 #if defined(TOOLKIT_VIEWS) || defined(OS_LINUX) |
| 1104 InfoBarDelegate* infobar = new MediaStreamInfoBarDelegate(infobar_helper, | 1104 InfoBarDelegate* infobar = new MediaStreamInfoBarDelegate(infobar_helper, |
| 1105 request, | 1105 request, |
| 1106 callback); | 1106 callback); |
| 1107 if (old_infobar) | 1107 if (old_infobar) |
| 1108 infobar_helper->ReplaceInfoBar(old_infobar, infobar); | 1108 infobar_helper->ReplaceInfoBar(old_infobar, infobar); |
| 1109 else | 1109 else |
| 1110 infobar_helper->AddInfoBar(infobar); | 1110 infobar_helper->AddInfoBar(infobar); |
| 1111 #elif defined(OS_LINUX) || defined(OS_MACOSX) | 1111 #elif defined(OS_MACOSX) |
| 1112 // TODO(macourteau): UI is not implemented yet for Linux and OS X. Fallback to | 1112 // TODO(macourteau): UI is not implemented yet for OS X. Fallback to |
| 1113 // the default behaviour and allow access to the first device of each | 1113 // the default behaviour and allow access to the first device of each |
| 1114 // requested type. | 1114 // requested type. |
| 1115 content::MediaStreamDevices devices; | 1115 content::MediaStreamDevices devices; |
| 1116 for (content::MediaStreamDeviceMap::const_iterator it = | 1116 for (content::MediaStreamDeviceMap::const_iterator it = |
| 1117 request->devices.begin(); it != request->devices.end(); ++it) { | 1117 request->devices.begin(); it != request->devices.end(); ++it) { |
| 1118 devices.push_back(*it->second.begin()); | 1118 devices.push_back(*it->second.begin()); |
| 1119 } | 1119 } |
| 1120 | 1120 |
| 1121 callback.Run(devices); | 1121 callback.Run(devices); |
| 1122 #endif // TOOLKIT_VIEWS | 1122 #endif // TOOLKIT_VIEWS |
|
macourteau
2012/03/01 15:32:29
Please also update this comment (i.e. "TOOLKIT_VIE
| |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 void ChromeContentBrowserClient::RequestDesktopNotificationPermission( | 1125 void ChromeContentBrowserClient::RequestDesktopNotificationPermission( |
| 1126 const GURL& source_origin, | 1126 const GURL& source_origin, |
| 1127 int callback_context, | 1127 int callback_context, |
| 1128 int render_process_id, | 1128 int render_process_id, |
| 1129 int render_view_id) { | 1129 int render_view_id) { |
| 1130 RenderViewHost* rvh = RenderViewHost::FromID( | 1130 RenderViewHost* rvh = RenderViewHost::FromID( |
| 1131 render_process_id, render_view_id); | 1131 render_process_id, render_view_id); |
| 1132 if (!rvh) { | 1132 if (!rvh) { |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1518 #if defined(USE_NSS) | 1518 #if defined(USE_NSS) |
| 1519 crypto::CryptoModuleBlockingPasswordDelegate* | 1519 crypto::CryptoModuleBlockingPasswordDelegate* |
| 1520 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1520 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 1521 const GURL& url) { | 1521 const GURL& url) { |
| 1522 return browser::NewCryptoModuleBlockingDialogDelegate( | 1522 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 1523 browser::kCryptoModulePasswordKeygen, url.host()); | 1523 browser::kCryptoModulePasswordKeygen, url.host()); |
| 1524 } | 1524 } |
| 1525 #endif | 1525 #endif |
| 1526 | 1526 |
| 1527 } // namespace chrome | 1527 } // namespace chrome |
| OLD | NEW |