| 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 28 matching lines...) Expand all Loading... |
| 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 void OnExtensionActivity( | 45 virtual void OnExtensionActivity( |
| 46 const Extension* extension, | 46 const Extension* extension, |
| 47 Activity activity, | 47 Activity activity, |
| 48 const std::string& message) = 0; | 48 const std::string& message) = 0; |
| 49 |
| 50 protected: |
| 51 virtual ~Observer() { } |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 // 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; |
| 52 // use GetInstance instead. | 55 // use GetInstance instead. |
| 53 static ActivityLog* GetInstance(Profile* profile); | 56 static ActivityLog* GetInstance(Profile* profile); |
| 54 | 57 |
| 55 // Currently, we only want to record actions if the user has opted in to the | 58 // Currently, we only want to record actions if the user has opted in to the |
| 56 // ActivityLog feature. | 59 // ActivityLog feature. |
| 57 bool IsLoggingEnabled(); | 60 bool IsLoggingEnabled(); |
| 58 | 61 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 virtual bool ServiceRedirectedInIncognito() const OVERRIDE; | 183 virtual bool ServiceRedirectedInIncognito() const OVERRIDE; |
| 181 | 184 |
| 182 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); | 185 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); |
| 183 }; | 186 }; |
| 184 | 187 |
| 185 | 188 |
| 186 } // namespace extensions | 189 } // namespace extensions |
| 187 | 190 |
| 188 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ | 191 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_H_ |
| 189 | 192 |
| OLD | NEW |