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

Unified Diff: chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.cc

Issue 2688513005: cros: Open play store app for md-settings stylus "Find more apps" link (Closed)
Patch Set: Created 3 years, 10 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 | « chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.cc
diff --git a/chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.cc b/chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.cc
index 0a7d66213e402929985b2b223a2ac10deeecf2e0..60ccced9108b21a614e2fad40cc9b3e2ad67e1b3 100644
--- a/chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.cc
+++ b/chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.cc
@@ -6,7 +6,9 @@
#include "ash/common/system/chromeos/palette/palette_utils.h"
#include "base/bind.h"
+#include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "ui/events/devices/input_device_manager.h"
namespace chromeos {
@@ -44,6 +46,9 @@ void StylusHandler::RegisterMessages() {
"setPreferredNoteTakingApp",
base::Bind(&StylusHandler::SetPreferredNoteTakingApp,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "showPlayStoreApps",
+ base::Bind(&StylusHandler::ShowPlayStoreApps, base::Unretained(this)));
}
void StylusHandler::OnAvailableNoteTakingAppsUpdated() {
@@ -116,5 +121,17 @@ void StylusHandler::SendHasStylus() {
base::FundamentalValue(ash::palette_utils::HasStylusInput()));
}
+void StylusHandler::ShowPlayStoreApps(const base::ListValue* args) {
+ std::string apps_url;
+ args->GetString(0, &apps_url);
+ Profile* profile = Profile::FromWebUI(web_ui());
+ if (!arc::IsArcAllowedForProfile(profile)) {
+ VLOG(1) << "ARC is not enabled for this profile";
+ return;
+ }
+
+ arc::LaunchPlayStoreWithUrl(apps_url);
+}
+
} // namespace settings
} // namespace chromeos
« no previous file with comments | « chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698