Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 9570012: Implement Linux Media Stream Infobar (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix Peter's comments Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 TabContentsWrapper::GetCurrentWrapperForContents(contents); 1107 TabContentsWrapper::GetCurrentWrapperForContents(contents);
1108 DCHECK(tab); 1108 DCHECK(tab);
1109 1109
1110 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); 1110 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper();
1111 InfoBarDelegate* old_infobar = NULL; 1111 InfoBarDelegate* old_infobar = NULL;
1112 for (size_t i = 0; i < infobar_helper->infobar_count() && !old_infobar; ++i) { 1112 for (size_t i = 0; i < infobar_helper->infobar_count() && !old_infobar; ++i) {
1113 old_infobar = 1113 old_infobar =
1114 infobar_helper->GetInfoBarDelegateAt(i)->AsMediaStreamInfobarDelegate(); 1114 infobar_helper->GetInfoBarDelegateAt(i)->AsMediaStreamInfobarDelegate();
1115 } 1115 }
1116 1116
1117 #if defined(TOOLKIT_VIEWS) 1117 #if defined(TOOLKIT_VIEWS) || defined(OS_LINUX)
1118 InfoBarDelegate* infobar = new MediaStreamInfoBarDelegate(infobar_helper, 1118 InfoBarDelegate* infobar = new MediaStreamInfoBarDelegate(infobar_helper,
1119 request, 1119 request,
1120 callback); 1120 callback);
1121 if (old_infobar) 1121 if (old_infobar)
1122 infobar_helper->ReplaceInfoBar(old_infobar, infobar); 1122 infobar_helper->ReplaceInfoBar(old_infobar, infobar);
1123 else 1123 else
1124 infobar_helper->AddInfoBar(infobar); 1124 infobar_helper->AddInfoBar(infobar);
1125 #elif defined(OS_LINUX) || defined(OS_MACOSX) 1125 #elif defined(OS_MACOSX)
1126 // TODO(macourteau): UI is not implemented yet for Linux and OS X. Fallback to 1126 // TODO(macourteau): UI is not implemented yet for OS X. Fallback to
1127 // the default behaviour and allow access to the first device of each 1127 // the default behaviour and allow access to the first device of each
1128 // requested type. 1128 // requested type.
1129 content::MediaStreamDevices devices; 1129 content::MediaStreamDevices devices;
1130 for (content::MediaStreamDeviceMap::const_iterator it = 1130 for (content::MediaStreamDeviceMap::const_iterator it =
1131 request->devices.begin(); it != request->devices.end(); ++it) { 1131 request->devices.begin(); it != request->devices.end(); ++it) {
1132 if (!it->second.empty()) 1132 if (!it->second.empty())
1133 devices.push_back(*it->second.begin()); 1133 devices.push_back(*it->second.begin());
1134 } 1134 }
1135 1135
1136 callback.Run(devices); 1136 callback.Run(devices);
1137 #endif // TOOLKIT_VIEWS 1137 #endif // TOOLKIT_VIEWS || OS_LINUX
1138 } 1138 }
1139 1139
1140 void ChromeContentBrowserClient::RequestDesktopNotificationPermission( 1140 void ChromeContentBrowserClient::RequestDesktopNotificationPermission(
1141 const GURL& source_origin, 1141 const GURL& source_origin,
1142 int callback_context, 1142 int callback_context,
1143 int render_process_id, 1143 int render_process_id,
1144 int render_view_id) { 1144 int render_view_id) {
1145 #if defined(ENABLE_NOTIFICATIONS) 1145 #if defined(ENABLE_NOTIFICATIONS)
1146 RenderViewHost* rvh = RenderViewHost::FromID( 1146 RenderViewHost* rvh = RenderViewHost::FromID(
1147 render_process_id, render_view_id); 1147 render_process_id, render_view_id);
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 #if defined(USE_NSS) 1590 #if defined(USE_NSS)
1591 crypto::CryptoModuleBlockingPasswordDelegate* 1591 crypto::CryptoModuleBlockingPasswordDelegate*
1592 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 1592 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
1593 const GURL& url) { 1593 const GURL& url) {
1594 return browser::NewCryptoModuleBlockingDialogDelegate( 1594 return browser::NewCryptoModuleBlockingDialogDelegate(
1595 browser::kCryptoModulePasswordKeygen, url.host()); 1595 browser::kCryptoModulePasswordKeygen, url.host());
1596 } 1596 }
1597 #endif 1597 #endif
1598 1598
1599 } // namespace chrome 1599 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698