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

Side by Side Diff: ash/wm/overlay_event_filter.cc

Issue 461093003: Fix the bug of multiple overlays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more tests Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/overlay_event_filter.h" 5 #include "ash/wm/overlay_event_filter.h"
6 6
7 #include "ash/wm/partial_screenshot_view.h" 7 #include "ash/wm/partial_screenshot_view.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura/window_delegate.h" 9 #include "ui/aura/window_delegate.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void OverlayEventFilter::OnAppTerminating() { 50 void OverlayEventFilter::OnAppTerminating() {
51 Cancel(); 51 Cancel();
52 } 52 }
53 53
54 void OverlayEventFilter::OnLockStateChanged(bool locked) { 54 void OverlayEventFilter::OnLockStateChanged(bool locked) {
55 Cancel(); 55 Cancel();
56 } 56 }
57 57
58 void OverlayEventFilter::Activate(Delegate* delegate) { 58 void OverlayEventFilter::Activate(Delegate* delegate) {
59 if (delegate_)
60 delegate_->Cancel();
59 delegate_ = delegate; 61 delegate_ = delegate;
60 } 62 }
61 63
62 void OverlayEventFilter::Deactivate() { 64 void OverlayEventFilter::Deactivate(Delegate* delegate) {
63 delegate_ = NULL; 65 if (delegate_ == delegate)
66 delegate_ = NULL;
64 } 67 }
65 68
66 void OverlayEventFilter::Cancel() { 69 void OverlayEventFilter::Cancel() {
67 if (delegate_) 70 if (delegate_)
68 delegate_->Cancel(); 71 delegate_->Cancel();
69 } 72 }
70 73
74 bool OverlayEventFilter::IsActive() {
75 return delegate_;
76 }
77
71 } // namespace ash 78 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698