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

Unified Diff: ash/wm/partial_screenshot_event_filter.cc

Issue 10008074: Cancel partial screenshot UI when lock happens. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: coding style fix Created 8 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
« no previous file with comments | « ash/wm/partial_screenshot_event_filter.h ('k') | ash/wm/power_button_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/partial_screenshot_event_filter.cc
diff --git a/ash/wm/partial_screenshot_event_filter.cc b/ash/wm/partial_screenshot_event_filter.cc
index ce21e0070de487809367dd104161ca63cd6bcfa9..02c202b9b71000749d64bbdc07a27ad271ae0ec4 100644
--- a/ash/wm/partial_screenshot_event_filter.cc
+++ b/ash/wm/partial_screenshot_event_filter.cc
@@ -32,7 +32,7 @@ bool PartialScreenshotEventFilter::PreHandleKeyEvent(
}
if (event->key_code() == ui::VKEY_ESCAPE)
- view_->Cancel();
+ Cancel();
// Always handled: other windows shouldn't receive input while we're
// taking a screenshot.
@@ -54,6 +54,19 @@ ui::GestureStatus PartialScreenshotEventFilter::PreHandleGestureEvent(
return ui::GESTURE_STATUS_UNKNOWN; // Not handled.
}
+void PartialScreenshotEventFilter::OnLoginStateChanged(
+ user::LoginStatus status) {
+ Cancel();
+}
+
+void PartialScreenshotEventFilter::OnAppTerminating() {
+ Cancel();
+}
+
+void PartialScreenshotEventFilter::OnLockStateChanged(bool locked) {
+ Cancel();
+}
+
void PartialScreenshotEventFilter::Activate(PartialScreenshotView* view) {
view_ = view;
}
@@ -62,5 +75,9 @@ void PartialScreenshotEventFilter::Deactivate() {
view_ = NULL;
}
+void PartialScreenshotEventFilter::Cancel() {
+ if (view_)
+ view_->Cancel();
+}
} // namespace internal
} // namespace ash
« no previous file with comments | « ash/wm/partial_screenshot_event_filter.h ('k') | ash/wm/power_button_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698