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

Side by Side Diff: ui/events/scoped_target_handler.h

Issue 1411833006: Refactoring to make adding ink drop animations easier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor ink drop animations (simplify MenuButton) Created 5 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_EVENTS_SCOPED_TARGET_HANDLER_H_
6 #define UI_EVENTS_SCOPED_TARGET_HANDLER_H_
7
8 #include "base/macros.h"
9 #include "ui/events/events_export.h"
10
11 namespace ui {
12
13 class EventHandler;
14 class EventTarget;
15
bruthig 2015/11/19 16:49:53 Some class level documentation would be useful her
varkha 2015/11/19 23:34:35 Done.
16 class EVENTS_EXPORT ScopedTargetHandler {
bruthig 2015/11/19 16:49:53 I envisioned that ScopedTargetHandler (or general
varkha 2015/11/19 23:34:35 Done.
17 public:
18 ScopedTargetHandler(EventTarget* target, EventHandler* handler);
19 virtual ~ScopedTargetHandler();
20
21 EventHandler* original_target_handler() { return original_handler_; }
22
23 private:
24 // An EventTarget that is used to set and restore |original_handler_|.
25 EventTarget* target_;
26
27 // New handler that is set on |target_| for the lifetime of |this|.
28 EventHandler* handler_;
29
30 // An EventHandler that gets restored on |target_| when |this| is destroyed.
31 EventHandler* original_handler_;
32
33 DISALLOW_COPY_AND_ASSIGN(ScopedTargetHandler);
34 };
35
36 } // namespace ui
37
38 #endif // UI_EVENTS_SCOPED_TARGET_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698