| 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 |
| 46 virtual void OnExtensionActivity( | 48 virtual void OnExtensionActivity( |
| 47 const Extension* extension, | 49 const Extension* extension, |
| 48 Activity activity, | 50 Activity activity, |
| 49 const std::string& message) = 0; | 51 const std::string& message) = 0; |
| 50 }; | 52 }; |
| 51 | 53 |
| 52 // ActivityLog is a singleton, so don't instantiate it with the constructor; | 54 // ActivityLog is a singleton, so don't instantiate it with the constructor; |
| 53 // use GetInstance instead. | 55 // use GetInstance instead. |
| 54 static ActivityLog* GetInstance(Profile* profile); | 56 static ActivityLog* GetInstance(Profile* profile); |
| 55 | 57 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 194 |
| 193 virtual bool ServiceRedirectedInIncognito() const OVERRIDE; | 195 virtual bool ServiceRedirectedInIncognito() const OVERRIDE; |
| 194 | 196 |
| 195 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); | 197 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); |
| 196 }; | 198 }; |
| 197 | 199 |
| 198 | 200 |
| 199 } // namespace extensions | 201 } // namespace extensions |
| 200 | 202 |
| 201 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ | 203 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ |
| OLD | NEW |