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

Unified Diff: chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc

Issue 2803403002: Support region selection for voice interaction session (Closed)
Patch Set: Addressed comments Created 3 years, 8 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 | « no previous file | chrome/browser/ui/ash/palette_delegate_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
diff --git a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
index f86630eefae068591cb8557b66842d3aa03325aa..94d180cb3998bc20b22215908c94902b9bfa3880 100644
--- a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
+++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
@@ -66,6 +66,10 @@ void ArcVoiceInteractionFrameworkService::OnInstanceReady() {
ash::Shell::Get()->accelerator_controller()->Register(
{ui::Accelerator(ui::VKEY_A, ui::EF_COMMAND_DOWN)}, this);
+ // Temporary shortcut added to enable the metalayer experiment.
+ ash::Shell::Get()->accelerator_controller()->Register(
+ {ui::Accelerator(ui::VKEY_A, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN)},
+ this);
}
void ArcVoiceInteractionFrameworkService::OnInstanceClosed() {
@@ -76,12 +80,23 @@ void ArcVoiceInteractionFrameworkService::OnInstanceClosed() {
bool ArcVoiceInteractionFrameworkService::AcceleratorPressed(
const ui::Accelerator& accelerator) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- mojom::VoiceInteractionFrameworkInstance* framework_instance =
- ARC_GET_INSTANCE_FOR_METHOD(
- arc_bridge_service()->voice_interaction_framework(),
- StartVoiceInteractionSession);
- DCHECK(framework_instance);
- framework_instance->StartVoiceInteractionSession();
+
+ if (accelerator.IsShiftDown()) {
+ mojom::VoiceInteractionFrameworkInstance* framework_instance =
+ ARC_GET_INSTANCE_FOR_METHOD(
+ arc_bridge_service()->voice_interaction_framework(),
+ ToggleMetalayer);
+ DCHECK(framework_instance);
+ framework_instance->ToggleMetalayer();
+ } else {
+ mojom::VoiceInteractionFrameworkInstance* framework_instance =
+ ARC_GET_INSTANCE_FOR_METHOD(
+ arc_bridge_service()->voice_interaction_framework(),
+ StartVoiceInteractionSession);
+ DCHECK(framework_instance);
+ framework_instance->StartVoiceInteractionSession();
+ }
+
return true;
}
« no previous file with comments | « no previous file | chrome/browser/ui/ash/palette_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698