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

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: Use observers 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
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..da0ff29899d4cb3d8ef9751ea8542be7859043b8 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::OnLoginStateChange(bool logged_in,
+ bool is_guest) {
+ Cancel();
+}
+
+void PartialScreenshotEventFilter::OnExit() {
+ Cancel();
+}
+
+void PartialScreenshotEventFilter::OnLockStateChange(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

Powered by Google App Engine
This is Rietveld 408576698