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

Unified Diff: chrome/browser/ui/ash/palette_delegate_chromeos.cc

Issue 2824703006: Add MetalayerMode to the palette. (Closed)
Patch Set: Fixed copyright year 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
Index: chrome/browser/ui/ash/palette_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/palette_delegate_chromeos.cc b/chrome/browser/ui/ash/palette_delegate_chromeos.cc
index b9a52a706cf89fe8296a76a4eedd42e0f11575a0..cfa955358f87a11b903e135db58799ce5d57b5c6 100644
--- a/chrome/browser/ui/ash/palette_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/palette_delegate_chromeos.cc
@@ -179,8 +179,7 @@ void PaletteDelegateChromeOS::TakePartialScreenshot(const base::Closure& done) {
auto* screenshot_controller = ash::Shell::Get()->screenshot_controller();
ash::ScreenshotDelegate* screenshot_delegate;
- if (arc::ArcVoiceInteractionFrameworkService::IsVoiceInteractionEnabled() &&
- arc::IsArcAllowedForProfile(profile_)) {
+ if (IsMetalayerSupported()) {
// This is an experimental mode. It will be either taken out or grow
// into a separate tool next to "Capture region".
if (!voice_interaction_screenshot_delegate_) {
@@ -206,4 +205,35 @@ void PaletteDelegateChromeOS::CancelPartialScreenshot() {
ash::Shell::Get()->screenshot_controller()->CancelScreenshotSession();
}
+bool PaletteDelegateChromeOS::IsMetalayerSupported() {
+ if (!arc::IsArcAllowedForProfile(profile_))
+ return false;
+
+ arc::ArcVoiceInteractionFrameworkService* service =
+ arc::ArcServiceManager::Get()
+ ->GetService<arc::ArcVoiceInteractionFrameworkService>();
+ return service && service->IsMetalayerSupported();
+}
+
+void PaletteDelegateChromeOS::ShowMetalayer(const base::Closure& closed) {
+ arc::ArcVoiceInteractionFrameworkService* service =
+ arc::ArcServiceManager::Get()
+ ->GetService<arc::ArcVoiceInteractionFrameworkService>();
+ if (!service) {
+ if (!closed.is_null())
+ closed.Run();
+ return;
+ }
+ service->ShowMetalayer(closed);
+}
+
+void PaletteDelegateChromeOS::HideMetalayer() {
+ arc::ArcVoiceInteractionFrameworkService* service =
+ arc::ArcServiceManager::Get()
+ ->GetService<arc::ArcVoiceInteractionFrameworkService>();
+ if (!service)
+ return;
+ service->HideMetalayer();
+}
+
} // namespace chromeos
« no previous file with comments | « chrome/browser/ui/ash/palette_delegate_chromeos.h ('k') | components/arc/common/voice_interaction_framework.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698