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

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: 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/shell_observer.h ('k') | ash/wm/partial_screenshot_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..285d3e7b2b3352e6e7a621ada7ffa25db771502c 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 OnLoginStateChanged(user::LoginStatus status) OVERRIDE;
+ virtual void OnAppTerminating() OVERRIDE;
+ virtual void OnLockStateChanged(bool locked) OVERRIDE;
+
private:
PartialScreenshotView* view_;
« no previous file with comments | « ash/shell_observer.h ('k') | ash/wm/partial_screenshot_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698