OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/chromeos/arc/voice_interaction/arc_voice_interaction_fr
amework_service.h" | 5 #include "chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_fr
amework_service.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/accelerators/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 void ArcVoiceInteractionFrameworkService::HideMetalayer() { | 296 void ArcVoiceInteractionFrameworkService::HideMetalayer() { |
297 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 297 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
298 if (metalayer_closed_callback_.is_null()) { | 298 if (metalayer_closed_callback_.is_null()) { |
299 LOG(ERROR) << "Metalayer is already hidden"; | 299 LOG(ERROR) << "Metalayer is already hidden"; |
300 return; | 300 return; |
301 } | 301 } |
302 metalayer_closed_callback_ = base::Closure(); | 302 metalayer_closed_callback_ = base::Closure(); |
303 SetMetalayerVisibility(false); | 303 SetMetalayerVisibility(false); |
304 } | 304 } |
305 | 305 |
| 306 void ArcVoiceInteractionFrameworkService::StartVoiceInteractionSetupWizard() { |
| 307 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 308 arc::mojom::VoiceInteractionFrameworkInstance* framework_instance = |
| 309 ARC_GET_INSTANCE_FOR_METHOD( |
| 310 arc_bridge_service()->voice_interaction_framework(), |
| 311 StartVoiceInteractionSetupWizard); |
| 312 if (!framework_instance) |
| 313 return; |
| 314 framework_instance->StartVoiceInteractionSetupWizard(); |
| 315 } |
| 316 |
306 void ArcVoiceInteractionFrameworkService::SetMetalayerVisibility(bool visible) { | 317 void ArcVoiceInteractionFrameworkService::SetMetalayerVisibility(bool visible) { |
307 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 318 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
308 mojom::VoiceInteractionFrameworkInstance* framework_instance = | 319 mojom::VoiceInteractionFrameworkInstance* framework_instance = |
309 ARC_GET_INSTANCE_FOR_METHOD( | 320 ARC_GET_INSTANCE_FOR_METHOD( |
310 arc_bridge_service()->voice_interaction_framework(), | 321 arc_bridge_service()->voice_interaction_framework(), |
311 SetMetalayerVisibility); | 322 SetMetalayerVisibility); |
312 if (!framework_instance) { | 323 if (!framework_instance) { |
313 if (!metalayer_closed_callback_.is_null()) | 324 if (!metalayer_closed_callback_.is_null()) |
314 base::ResetAndReturn(&metalayer_closed_callback_).Run(); | 325 base::ResetAndReturn(&metalayer_closed_callback_).Run(); |
315 return; | 326 return; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 // If next request starts too soon and there is an active session in action, | 421 // If next request starts too soon and there is an active session in action, |
411 // we should drop it. | 422 // we should drop it. |
412 return false; | 423 return false; |
413 } | 424 } |
414 user_interaction_start_time_ = start_time; | 425 user_interaction_start_time_ = start_time; |
415 context_request_remaining_count_ = kContextRequestMaxRemainingCount; | 426 context_request_remaining_count_ = kContextRequestMaxRemainingCount; |
416 return true; | 427 return true; |
417 } | 428 } |
418 | 429 |
419 } // namespace arc | 430 } // namespace arc |
OLD | NEW |