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

Side by Side Diff: base/event_recorder.h

Issue 6747014: Base: Last set of files to use BASE_API (for base.dll) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef BASE_EVENT_RECORDER_H_ 5 #ifndef BASE_EVENT_RECORDER_H_
6 #define BASE_EVENT_RECORDER_H_ 6 #define BASE_EVENT_RECORDER_H_
7 #pragma once 7 #pragma once
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
11 #include <stdio.h> 11 #include <stdio.h>
12 #endif 12 #endif
13
14 #include "base/base_api.h"
13 #include "base/basictypes.h" 15 #include "base/basictypes.h"
14 16
15 class FilePath; 17 class FilePath;
16 18
17 namespace base { 19 namespace base {
18 20
19 // A class for recording and playing back keyboard and mouse input events. 21 // A class for recording and playing back keyboard and mouse input events.
20 // 22 //
21 // Note - if you record events, and the playback with the windows in 23 // Note - if you record events, and the playback with the windows in
22 // different sizes or positions, the playback will fail. When 24 // different sizes or positions, the playback will fail. When
23 // recording and playing, you should move the relevant windows 25 // recording and playing, you should move the relevant windows
24 // to constant sizes and locations. 26 // to constant sizes and locations.
25 // TODO(mbelshe) For now this is a singleton. I believe that this class 27 // TODO(mbelshe) For now this is a singleton. I believe that this class
26 // could be easily modified to: 28 // could be easily modified to:
27 // support two simultaneous recorders 29 // support two simultaneous recorders
28 // be playing back events while already recording events. 30 // be playing back events while already recording events.
29 // Why? Imagine if the product had a "record a macro" feature. 31 // Why? Imagine if the product had a "record a macro" feature.
30 // You might be recording globally, while recording or playing back 32 // You might be recording globally, while recording or playing back
31 // a macro. I don't think two playbacks make sense. 33 // a macro. I don't think two playbacks make sense.
32 class EventRecorder { 34 class BASE_API EventRecorder {
33 public: 35 public:
34 // Get the singleton EventRecorder. 36 // Get the singleton EventRecorder.
35 // We can only handle one recorder/player at a time. 37 // We can only handle one recorder/player at a time.
36 static EventRecorder* current() { 38 static EventRecorder* current() {
37 if (!current_) 39 if (!current_)
38 current_ = new EventRecorder(); 40 current_ = new EventRecorder();
39 return current_; 41 return current_;
40 } 42 }
41 43
42 // Starts recording events. 44 // Starts recording events.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 #endif 99 #endif
98 int playback_first_msg_time_; 100 int playback_first_msg_time_;
99 int playback_start_time_; 101 int playback_start_time_;
100 102
101 DISALLOW_COPY_AND_ASSIGN(EventRecorder); 103 DISALLOW_COPY_AND_ASSIGN(EventRecorder);
102 }; 104 };
103 105
104 } // namespace base 106 } // namespace base
105 107
106 #endif // BASE_EVENT_RECORDER_H_ 108 #endif // BASE_EVENT_RECORDER_H_
OLDNEW
« base/base_api.h ('K') | « base/debug/trace_event_win.h ('k') | base/file_util_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698