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

Unified Diff: chrome/browser/ui/app_list/start_page_service.cc

Issue 29763004: Embeds offline voice recognizer plugin and its manager to app-list start page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 2 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
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service.h ('k') | chrome/browser/ui/webui/app_list/start_page_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service.h ('k') | chrome/browser/ui/webui/app_list/start_page_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698