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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 TabContentsWrapper::GetCurrentWrapperForContents(contents); | 1118 TabContentsWrapper::GetCurrentWrapperForContents(contents); |
1119 DCHECK(tab); | 1119 DCHECK(tab); |
1120 | 1120 |
1121 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); | 1121 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); |
1122 InfoBarDelegate* old_infobar = NULL; | 1122 InfoBarDelegate* old_infobar = NULL; |
1123 for (size_t i = 0; i < infobar_helper->infobar_count() && !old_infobar; ++i) { | 1123 for (size_t i = 0; i < infobar_helper->infobar_count() && !old_infobar; ++i) { |
1124 old_infobar = | 1124 old_infobar = |
1125 infobar_helper->GetInfoBarDelegateAt(i)->AsMediaStreamInfoBarDelegate(); | 1125 infobar_helper->GetInfoBarDelegateAt(i)->AsMediaStreamInfoBarDelegate(); |
1126 } | 1126 } |
1127 | 1127 |
1128 InfoBarDelegate* infobar = new MediaStreamInfoBarDelegate(infobar_helper, | 1128 scoped_ptr<MediaStreamInfoBarDelegate> |
1129 request, | 1129 infobar(new MediaStreamInfoBarDelegate(infobar_helper, |
1130 callback); | 1130 tab->profile(), |
1131 if (old_infobar) | 1131 request, |
1132 infobar_helper->ReplaceInfoBar(old_infobar, infobar); | 1132 callback)); |
1133 else | 1133 if (infobar->ShouldShowInfoBar()) { |
1134 infobar_helper->AddInfoBar(infobar); | 1134 if (old_infobar) |
| 1135 infobar_helper->ReplaceInfoBar(old_infobar, infobar.release()); |
| 1136 else |
| 1137 infobar_helper->AddInfoBar(infobar.release()); |
| 1138 } |
1135 } | 1139 } |
1136 | 1140 |
1137 content::MediaObserver* ChromeContentBrowserClient::GetMediaObserver() { | 1141 content::MediaObserver* ChromeContentBrowserClient::GetMediaObserver() { |
1138 return MediaInternals::GetInstance(); | 1142 return MediaInternals::GetInstance(); |
1139 } | 1143 } |
1140 | 1144 |
1141 void ChromeContentBrowserClient::RequestDesktopNotificationPermission( | 1145 void ChromeContentBrowserClient::RequestDesktopNotificationPermission( |
1142 const GURL& source_origin, | 1146 const GURL& source_origin, |
1143 int callback_context, | 1147 int callback_context, |
1144 int render_process_id, | 1148 int render_process_id, |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 #if defined(USE_NSS) | 1611 #if defined(USE_NSS) |
1608 crypto::CryptoModuleBlockingPasswordDelegate* | 1612 crypto::CryptoModuleBlockingPasswordDelegate* |
1609 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1613 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
1610 const GURL& url) { | 1614 const GURL& url) { |
1611 return browser::NewCryptoModuleBlockingDialogDelegate( | 1615 return browser::NewCryptoModuleBlockingDialogDelegate( |
1612 browser::kCryptoModulePasswordKeygen, url.host()); | 1616 browser::kCryptoModulePasswordKeygen, url.host()); |
1613 } | 1617 } |
1614 #endif | 1618 #endif |
1615 | 1619 |
1616 } // namespace chrome | 1620 } // namespace chrome |
OLD | NEW |