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

Unified Diff: ui/keyboard/keyboard_controller_proxy.cc

Issue 14646041: Allow virtual keyboard window to access audio stream and speech api for voice input (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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: ui/keyboard/keyboard_controller_proxy.cc
diff --git a/ui/keyboard/keyboard_controller_proxy.cc b/ui/keyboard/keyboard_controller_proxy.cc
index 33e2b71355e03d27744dc195f8dc238e2c38347b..6f73f2761390008bbba70e5e82aed614b760867f 100644
--- a/ui/keyboard/keyboard_controller_proxy.cc
+++ b/ui/keyboard/keyboard_controller_proxy.cc
@@ -19,7 +19,8 @@ namespace {
class KeyboardContentsDelegate : public content::WebContentsDelegate,
public content::WebContentsObserver {
public:
- KeyboardContentsDelegate() {}
+ KeyboardContentsDelegate(keyboard::KeyboardControllerProxy* proxy)
sadrul 2013/05/16 19:34:08 explicit
+ : proxy_(proxy) {}
virtual ~KeyboardContentsDelegate() {}
private:
@@ -33,11 +34,21 @@ class KeyboardContentsDelegate : public content::WebContentsDelegate,
return source;
}
+ // Overridden from content::WebContentsDelegate:
+ virtual void RequestMediaAccessPermission(content::WebContents* web_contents,
bryeung 2013/05/16 20:34:49 nit: move this argument to the next line as well
+ const content::MediaStreamRequest& request,
+ const content::MediaResponseCallback& callback) OVERRIDE {
+ proxy_->RequestAudioInput(web_contents, request, callback);
+ }
+
+
// Overridden from content::WebContentsObserver:
virtual void WebContentsDestroyed(content::WebContents* contents) OVERRIDE {
delete this;
}
+ keyboard::KeyboardControllerProxy* proxy_;
+
DISALLOW_COPY_AND_ASSIGN(KeyboardContentsDelegate);
};
@@ -58,7 +69,7 @@ aura::Window* KeyboardControllerProxy::GetKeyboardWindow() {
keyboard_contents_.reset(content::WebContents::Create(
content::WebContents::CreateParams(context,
content::SiteInstance::CreateForURL(context, url))));
- keyboard_contents_->SetDelegate(new KeyboardContentsDelegate);
+ keyboard_contents_->SetDelegate(new KeyboardContentsDelegate(this));
SetupWebContents(keyboard_contents_.get());
content::OpenURLParams params(url,

Powered by Google App Engine
This is Rietveld 408576698