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/speech/chrome_speech_recognition_manager_delegate.h" | 5 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 | 542 |
543 WebContents* web_contents = WebContents::FromRenderViewHost(render_view_host); | 543 WebContents* web_contents = WebContents::FromRenderViewHost(render_view_host); |
544 extensions::ViewType view_type = extensions::GetViewType(web_contents); | 544 extensions::ViewType view_type = extensions::GetViewType(web_contents); |
545 | 545 |
546 // TODO(kalman): Also enable speech bubble for extension popups | 546 // TODO(kalman): Also enable speech bubble for extension popups |
547 // (VIEW_TYPE_EXTENSION_POPUP) once popup-like control UI works properly in | 547 // (VIEW_TYPE_EXTENSION_POPUP) once popup-like control UI works properly in |
548 // extensions: http://crbug.com/163851. | 548 // extensions: http://crbug.com/163851. |
549 // Right now the extension popup closes and dismisses immediately on user | 549 // Right now the extension popup closes and dismisses immediately on user |
550 // click. | 550 // click. |
551 if (view_type == extensions::VIEW_TYPE_TAB_CONTENTS || | 551 if (view_type == extensions::VIEW_TYPE_TAB_CONTENTS || |
552 view_type == extensions::VIEW_TYPE_APP_SHELL) { | 552 view_type == extensions::VIEW_TYPE_APP_SHELL || |
| 553 view_type == extensions::VIEW_TYPE_VIRTUAL_KEYBOARD) { |
553 // If it is a tab, we can show the speech input bubble or ask for | 554 // If it is a tab, we can show the speech input bubble or ask for |
554 // permission. | 555 // permission. |
555 | 556 |
556 allowed = true; | 557 allowed = true; |
557 if (js_api) | 558 if (js_api) |
558 ask_permission = true; | 559 ask_permission = true; |
559 } | 560 } |
560 | 561 |
561 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 562 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
562 base::Bind(callback, ask_permission, allowed)); | 563 base::Bind(callback, ask_permission, allowed)); |
563 } | 564 } |
564 | 565 |
565 SpeechRecognitionBubbleController* | 566 SpeechRecognitionBubbleController* |
566 ChromeSpeechRecognitionManagerDelegate::GetBubbleController() { | 567 ChromeSpeechRecognitionManagerDelegate::GetBubbleController() { |
567 if (!bubble_controller_.get()) | 568 if (!bubble_controller_.get()) |
568 bubble_controller_ = new SpeechRecognitionBubbleController(this); | 569 bubble_controller_ = new SpeechRecognitionBubbleController(this); |
569 return bubble_controller_.get(); | 570 return bubble_controller_.get(); |
570 } | 571 } |
571 | 572 |
572 } // namespace speech | 573 } // namespace speech |
OLD | NEW |