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

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

Issue 2276233002: ash/chromeos: Add shift-alt-p shortcut to open palette. (Closed)
Patch Set: Address comments Created 4 years, 4 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/ash/palette_delegate_chromeos.h ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3192f8b4bfe9ba1cef05121b3f5c968977d1497f..8a1d2648402f454cc4d27e4854000475f7b33b04 100644
--- a/chrome/browser/ui/ash/palette_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/palette_delegate_chromeos.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/ash/palette_delegate_chromeos.h"
#include "ash/accelerators/accelerator_controller_delegate_aura.h"
+#include "ash/common/system/chromeos/palette/palette_utils.h"
#include "ash/magnifier/partial_magnification_controller.h"
#include "ash/screenshot_delegate.h"
#include "ash/shell.h"
@@ -24,6 +25,13 @@
namespace chromeos {
+// static
+std::unique_ptr<PaletteDelegateChromeOS> PaletteDelegateChromeOS::Create() {
+ if (!ash::IsPaletteFeatureEnabled())
+ return nullptr;
+ return base::WrapUnique(new PaletteDelegateChromeOS());
+}
+
PaletteDelegateChromeOS::PaletteDelegateChromeOS() {
registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED,
content::NotificationService::AllSources());
@@ -134,6 +142,13 @@ bool PaletteDelegateChromeOS::ShouldAutoOpenPalette() {
return profile_->GetPrefs()->GetBoolean(prefs::kLaunchPaletteOnEjectEvent);
}
+bool PaletteDelegateChromeOS::ShouldShowPalette() {
+ if (!profile_)
+ return false;
+
+ return profile_->GetPrefs()->GetBoolean(prefs::kEnableStylusTools);
+}
+
void PaletteDelegateChromeOS::TakeScreenshot() {
auto* screenshot_delegate = ash::Shell::GetInstance()
->accelerator_controller_delegate()
« no previous file with comments | « chrome/browser/ui/ash/palette_delegate_chromeos.h ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698