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

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

Issue 2929963002: Add value proposition entrypoint from Voice Interaction shortcut (Closed)
Patch Set: Add value proposition entrypoint from Voice Interaction shortcut Created 3 years, 6 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/login/wizard_controller.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 d3b1adb861a55fd187fc79fbe7b435836ab349ca..131d0bd12ec5f678b6d4d07bf235a7eb886d2c63 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
@@ -20,9 +20,14 @@
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/task_scheduler/post_task.h"
+#include "chrome/browser/chromeos/login/helper.h"
+#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
+#include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h"
#include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_util.h"
@@ -360,6 +365,22 @@ void ArcVoiceInteractionFrameworkService::StartSessionFromUserInteraction(
const gfx::Rect& rect) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ if (!ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
+ prefs::kArcVoiceInteractionValuePropAccepted)) {
+ // If voice interaction value prop already showing, return.
+ if (chromeos::LoginDisplayHost::default_host())
+ return;
+ // If voice interaction value prop has not been accepted, show the value
+ // prop OOBE page again.
+ gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size()));
+ // The display host will be destructed at the end of OOBE flow.
+ chromeos::LoginDisplayHostImpl* display_host =
+ new chromeos::LoginDisplayHostImpl(screen_bounds);
+ display_host->StartWizard(
+ chromeos::OobeScreen::SCREEN_VOICE_INTERACTION_VALUE_PROP);
+ return;
+ }
+
if (!arc_bridge_service()->voice_interaction_framework()->has_instance()) {
SetArcCpuRestriction(false);
return;
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/wizard_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698