OLD | NEW |
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 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 25 matching lines...) Expand all Loading... |
36 enum Activity { | 36 enum Activity { |
37 ACTIVITY_EXTENSION_API_CALL, // Extension API invocation is called. | 37 ACTIVITY_EXTENSION_API_CALL, // Extension API invocation is called. |
38 ACTIVITY_EXTENSION_API_BLOCK, // Extension API invocation is blocked. | 38 ACTIVITY_EXTENSION_API_BLOCK, // Extension API invocation is blocked. |
39 ACTIVITY_CONTENT_SCRIPT, // Content script is executing. | 39 ACTIVITY_CONTENT_SCRIPT, // Content script is executing. |
40 ACTIVITY_EVENT_DISPATCH, // Event sent to listener in extension. | 40 ACTIVITY_EVENT_DISPATCH, // Event sent to listener in extension. |
41 }; | 41 }; |
42 | 42 |
43 // Observers can listen for activity events. | 43 // Observers can listen for activity events. |
44 class Observer { | 44 class Observer { |
45 public: | 45 public: |
46 virtual ~Observer() { } | |
47 | |
48 virtual void OnExtensionActivity( | 46 virtual void OnExtensionActivity( |
49 const Extension* extension, | 47 const Extension* extension, |
50 Activity activity, | 48 Activity activity, |
51 const std::string& message) = 0; | 49 const std::string& message) = 0; |
52 }; | 50 }; |
53 | 51 |
54 // ActivityLog is a singleton, so don't instantiate it with the constructor; | 52 // ActivityLog is a singleton, so don't instantiate it with the constructor; |
55 // use GetInstance instead. | 53 // use GetInstance instead. |
56 static ActivityLog* GetInstance(Profile* profile); | 54 static ActivityLog* GetInstance(Profile* profile); |
57 | 55 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 192 |
195 virtual bool ServiceRedirectedInIncognito() const OVERRIDE; | 193 virtual bool ServiceRedirectedInIncognito() const OVERRIDE; |
196 | 194 |
197 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); | 195 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); |
198 }; | 196 }; |
199 | 197 |
200 | 198 |
201 } // namespace extensions | 199 } // namespace extensions |
202 | 200 |
203 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ | 201 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ |
OLD | NEW |