Index: chrome/browser/ui/app_list/start_page_service.cc |
diff --git a/chrome/browser/ui/app_list/start_page_service.cc b/chrome/browser/ui/app_list/start_page_service.cc |
index 6c9d35f70f0995310ef430ccaadf335c8b2f32e8..06d6501d14a9b9b8ccf259cb830f86c857565f11 100644 |
--- a/chrome/browser/ui/app_list/start_page_service.cc |
+++ b/chrome/browser/ui/app_list/start_page_service.cc |
@@ -11,6 +11,7 @@ |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/extensions/extension_system_factory.h" |
#include "chrome/browser/extensions/install_tracker_factory.h" |
+#include "chrome/browser/media/media_stream_infobar_delegate.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/app_list/recommended_apps.h" |
#include "chrome/common/chrome_switches.h" |
@@ -22,6 +23,7 @@ |
#include "content/public/browser/notification_registrar.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/web_contents.h" |
+#include "content/public/browser/web_contents_delegate.h" |
namespace app_list { |
@@ -88,6 +90,24 @@ class StartPageService::ExitObserver : public content::NotificationObserver { |
DISALLOW_COPY_AND_ASSIGN(ExitObserver); |
}; |
+class StartPageService::StartPageWebContentsDelegate |
+ : public content::WebContentsDelegate { |
+ public: |
+ StartPageWebContentsDelegate() {} |
+ virtual ~StartPageWebContentsDelegate() {} |
+ |
+ virtual void RequestMediaAccessPermission( |
+ content::WebContents* web_contents, |
+ const content::MediaStreamRequest& request, |
+ const content::MediaResponseCallback& callback) OVERRIDE { |
+ if (MediaStreamInfoBarDelegate::Create(web_contents, request, callback)) |
+ NOTREACHED() << "Media stream not allowed for WebUI"; |
+ } |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(StartPageWebContentsDelegate); |
+}; |
+ |
// static |
StartPageService* StartPageService::Get(Profile* profile) { |
return Factory::GetForProfile(profile); |
@@ -99,6 +119,8 @@ StartPageService::StartPageService(Profile* profile) |
recommended_apps_(new RecommendedApps(profile)) { |
contents_.reset(content::WebContents::Create( |
content::WebContents::CreateParams(profile_))); |
+ contents_delegate_.reset(new StartPageWebContentsDelegate()); |
+ contents_->SetDelegate(contents_delegate_.get()); |
GURL url(chrome::kChromeUIAppListStartPageURL); |
CommandLine* command_line = CommandLine::ForCurrentProcess(); |