| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_TEST_USER_ACTION_TESTER_H_ | 5 #ifndef BASE_TEST_USER_ACTION_TESTER_H_ |
| 6 #define BASE_TEST_USER_ACTION_TESTER_H_ | 6 #define BASE_TEST_USER_ACTION_TESTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 typedef std::map<std::string, int> UserActionCountMap; | 31 typedef std::map<std::string, int> UserActionCountMap; |
| 32 | 32 |
| 33 // The callback that is notified when a user actions occurs. | 33 // The callback that is notified when a user actions occurs. |
| 34 void OnUserAction(const std::string& user_action); | 34 void OnUserAction(const std::string& user_action); |
| 35 | 35 |
| 36 // A map that tracks the number of times a user action has occurred. | 36 // A map that tracks the number of times a user action has occurred. |
| 37 UserActionCountMap count_map_; | 37 UserActionCountMap count_map_; |
| 38 | 38 |
| 39 // A test task runner used by user metrics. |
| 40 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 41 |
| 39 // The callback that is added to the global action callback list. | 42 // The callback that is added to the global action callback list. |
| 40 base::ActionCallback action_callback_; | 43 base::ActionCallback action_callback_; |
| 41 | 44 |
| 42 DISALLOW_COPY_AND_ASSIGN(UserActionTester); | 45 DISALLOW_COPY_AND_ASSIGN(UserActionTester); |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 } // namespace base | 48 } // namespace base |
| 46 | 49 |
| 47 #endif // BASE_TEST_USER_ACTION_TESTER_H_ | 50 #endif // BASE_TEST_USER_ACTION_TESTER_H_ |
| OLD | NEW |