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

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

Issue 2898173006: restricts when context could be retrieved. (Closed)
Patch Set: fix meta layer shortcut key Created 3 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.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_arc_home_service.cc
diff --git a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc
index c924d23b2e0af85942996565f4a60fc3fac9db0e..782b32cb0cd51d289e5343015d21000d06c486ea 100644
--- a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc
+++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.h"
#include "chrome/browser/chromeos/first_run/first_run.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/browser/ui/browser.h"
@@ -19,6 +20,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/arc/arc_bridge_service.h"
+#include "components/arc/arc_service_manager.h"
#include "components/arc/instance_holder.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
@@ -92,6 +94,14 @@ void ArcVoiceInteractionArcHomeService::OnInstanceReady() {
void ArcVoiceInteractionArcHomeService::GetVoiceInteractionStructure(
const GetVoiceInteractionStructureCallback& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ auto* framework_service =
+ ArcServiceManager::Get()
+ ->GetService<ArcVoiceInteractionFrameworkService>();
+ if (!framework_service->ValidateTimeSinceUserInteraction()) {
+ callback.Run(mojom::VoiceInteractionStructure::New());
+ return;
+ }
Browser* browser = BrowserList::GetInstance()->GetLastActive();
if (!browser || !browser->window()->IsActive()) {
// TODO(muyuanli): retrieve context for apps.
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698