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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 10542092: Refactor the content interface for RequestMediaAccessPermission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 4f8f1ed564186e165173a10a4fa53ca3bc6761f8..1251ef2107df2da5ce4971a3de60007746397f9c 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -66,7 +66,6 @@
#include "chrome/browser/tab_contents/tab_contents_ssl_helper.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/toolkit_extra_parts.h"
-#include "chrome/browser/ui/media_stream_infobar_delegate.h"
#include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
@@ -1101,40 +1100,6 @@ void ChromeContentBrowserClient::AddNewCertificate(
new SSLAddCertHandler(request, cert, render_process_id, render_view_id);
}
-void ChromeContentBrowserClient::RequestMediaAccessPermission(
- const content::MediaStreamRequest* request,
- const content::MediaResponseCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
- WebContents* contents = tab_util::GetWebContentsByID(
- request->render_process_id, request->render_view_id);
- if (!contents) {
- // Abort, if the tab was closed after the request was made but before we
- // got to this point.
- callback.Run(content::MediaStreamDevices());
- return;
- }
-
Evan Stade 2012/06/09 05:47:38 it also would have been possible to just do conte
- TabContentsWrapper* tab =
- TabContentsWrapper::GetCurrentWrapperForContents(contents);
- DCHECK(tab);
-
- InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper();
- InfoBarDelegate* old_infobar = NULL;
- for (size_t i = 0; i < infobar_helper->infobar_count() && !old_infobar; ++i) {
- old_infobar =
- infobar_helper->GetInfoBarDelegateAt(i)->AsMediaStreamInfoBarDelegate();
- }
-
- InfoBarDelegate* infobar = new MediaStreamInfoBarDelegate(infobar_helper,
- request,
- callback);
- if (old_infobar)
- infobar_helper->ReplaceInfoBar(old_infobar, infobar);
- else
- infobar_helper->AddInfoBar(infobar);
-}
-
content::MediaObserver* ChromeContentBrowserClient::GetMediaObserver() {
return MediaInternals::GetInstance();
}

Powered by Google App Engine
This is Rietveld 408576698