| 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 24 matching lines...) Expand all Loading... |
| 35 public: | 35 public: |
| 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 }; | 40 }; |
| 41 | 41 |
| 42 // Observers can listen for activity events. | 42 // Observers can listen for activity events. |
| 43 class Observer { | 43 class Observer { |
| 44 public: | 44 public: |
| 45 virtual ~Observer() { } |
| 46 |
| 45 virtual void OnExtensionActivity( | 47 virtual void OnExtensionActivity( |
| 46 const Extension* extension, | 48 const Extension* extension, |
| 47 Activity activity, | 49 Activity activity, |
| 48 const std::string& message) = 0; | 50 const std::string& message) = 0; |
| 49 }; | 51 }; |
| 50 | 52 |
| 51 // ActivityLog is a singleton, so don't instantiate it with the constructor; | 53 // ActivityLog is a singleton, so don't instantiate it with the constructor; |
| 52 // use GetInstance instead. | 54 // use GetInstance instead. |
| 53 static ActivityLog* GetInstance(Profile* profile); | 55 static ActivityLog* GetInstance(Profile* profile); |
| 54 | 56 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 virtual bool ServiceRedirectedInIncognito() const OVERRIDE; | 182 virtual bool ServiceRedirectedInIncognito() const OVERRIDE; |
| 181 | 183 |
| 182 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); | 184 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); |
| 183 }; | 185 }; |
| 184 | 186 |
| 185 | 187 |
| 186 } // namespace extensions | 188 } // namespace extensions |
| 187 | 189 |
| 188 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ | 190 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ |
| 189 | 191 |
| OLD | NEW |