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

Unified Diff: ash/wm/partial_screenshot_event_filter.h

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.h
diff --git a/ash/wm/partial_screenshot_event_filter.h b/ash/wm/partial_screenshot_event_filter.h
index 5f045de8d6fc6f57026169fc7e2b6982aba00bed..5bf622ea058f3b9bb18fe8b0f7d46e7af014a4a1 100644
--- a/ash/wm/partial_screenshot_event_filter.h
+++ b/ash/wm/partial_screenshot_event_filter.h
@@ -6,6 +6,7 @@
#define ASH_WM_PARTIAL_SCREENSHOT_EVENT_FILTER_H_
#pragma once
+#include "ash/shell_observer.h"
#include "base/compiler_specific.h"
#include "ui/aura/event.h"
#include "ui/aura/event_filter.h"
@@ -20,7 +21,8 @@ namespace internal {
// main task of this event filter is just to stop propagation of any
// key events during activation, and also signal cancellation when Esc is
// pressed.
-class PartialScreenshotEventFilter : public aura::EventFilter {
+class PartialScreenshotEventFilter : public aura::EventFilter,
+ public ShellObserver {
public:
PartialScreenshotEventFilter();
virtual ~PartialScreenshotEventFilter();
@@ -34,7 +36,10 @@ class PartialScreenshotEventFilter : public aura::EventFilter {
// End the filtering of events.
void Deactivate();
- // Overridden from aura::EventFilter:
+ // Cancels the partial screenshot UI. Do nothing if it's not activated.
+ void Cancel();
+
+ // aura::EventFilter overrides:
virtual bool PreHandleKeyEvent(
aura::Window* target, aura::KeyEvent* event) OVERRIDE;
virtual bool PreHandleMouseEvent(
@@ -44,6 +49,11 @@ class PartialScreenshotEventFilter : public aura::EventFilter {
virtual ui::GestureStatus PreHandleGestureEvent(
aura::Window* target, aura::GestureEvent* event) OVERRIDE;
+ // ShellObserver overrides:
+ virtual void OnLoginStateChange(bool logged_in, bool is_guest) OVERRIDE;
+ virtual void OnExit() OVERRIDE;
+ virtual void OnLockStateChange(bool locked) OVERRIDE;
+
private:
PartialScreenshotView* view_;

Powered by Google App Engine
This is Rietveld 408576698