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

Unified Diff: ash/common/system/chromeos/palette/palette_tray.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 | « ash/common/system/chromeos/palette/palette_tray.h ('k') | ash/common/system/status_area_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/palette/palette_tray.cc
diff --git a/ash/common/system/chromeos/palette/palette_tray.cc b/ash/common/system/chromeos/palette/palette_tray.cc
index d205b4b04d4f3e9ebcc5b51c010092a52725f658..634c5cf476018cdf74a1f2de8bb11376955e5ba5 100644
--- a/ash/common/system/chromeos/palette/palette_tray.cc
+++ b/ash/common/system/chromeos/palette/palette_tray.cc
@@ -167,10 +167,13 @@ bool PaletteTray::PerformAction(const ui::Event& event) {
return true;
}
- return OpenBubble();
+ return ShowPalette();
}
-bool PaletteTray::OpenBubble() {
+bool PaletteTray::ShowPalette() {
+ if (bubble_)
+ return false;
+
views::TrayBubbleView::InitParams init_params(
views::TrayBubbleView::ANCHOR_TYPE_TRAY, GetAnchorAlignment(),
kPaletteWidth, kPaletteWidth);
@@ -196,7 +199,6 @@ bool PaletteTray::OpenBubble() {
bubble_.reset(new ash::TrayBubbleWrapper(this, bubble_view));
SetDrawBackgroundAsActive(true);
-
return true;
}
@@ -335,7 +337,7 @@ void PaletteTray::OnStylusStateChanged(ui::StylusState stylus_state) {
return;
if (stylus_state == ui::StylusState::REMOVED && !bubble_)
- OpenBubble();
+ ShowPalette();
else if (stylus_state == ui::StylusState::INSERTED && bubble_)
bubble_.reset();
}
« no previous file with comments | « ash/common/system/chromeos/palette/palette_tray.h ('k') | ash/common/system/status_area_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698