| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_API_ACTIONS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_API_ACTIONS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_API_ACTIONS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_API_ACTIONS_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/activity_log/activity_actions.h" | 8 #include "chrome/browser/extensions/activity_log/activity_actions.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 virtual bool Record(sql::Connection* db) OVERRIDE; | 48 virtual bool Record(sql::Connection* db) OVERRIDE; |
| 49 | 49 |
| 50 virtual scoped_ptr<api::activity_log_private::ExtensionActivity> | 50 virtual scoped_ptr<api::activity_log_private::ExtensionActivity> |
| 51 ConvertToExtensionActivity() OVERRIDE; | 51 ConvertToExtensionActivity() OVERRIDE; |
| 52 | 52 |
| 53 // Used to associate tab IDs with URLs. It will swap out the int in args with | 53 // Used to associate tab IDs with URLs. It will swap out the int in args with |
| 54 // a URL as a string. If the tab is in incognito mode, we leave it alone as | 54 // a URL as a string. If the tab is in incognito mode, we leave it alone as |
| 55 // the original int. There is a small chance that the URL translation could | 55 // the original int. There is a small chance that the URL translation could |
| 56 // be wrong, if the tab has already been navigated by the time of invocation. | 56 // be wrong, if the tab has already been navigated by the time of invocation. |
| 57 static void LookupTabId(const std::string& api_call, | 57 static void LookupTabId(const std::string& api_call, |
| 58 ListValue* args, | 58 base::ListValue* args, |
| 59 Profile* profile); | 59 Profile* profile); |
| 60 | 60 |
| 61 // Print a APIAction as a regular string for debugging purposes. | 61 // Print a APIAction as a regular string for debugging purposes. |
| 62 virtual std::string PrintForDebug() OVERRIDE; | 62 virtual std::string PrintForDebug() OVERRIDE; |
| 63 | 63 |
| 64 // Helper methods for recording the values into the db. | 64 // Helper methods for recording the values into the db. |
| 65 const std::string& api_call() const { return api_call_; } | 65 const std::string& api_call() const { return api_call_; } |
| 66 const std::string& args() const { return args_; } | 66 const std::string& args() const { return args_; } |
| 67 std::string TypeAsString() const; | 67 std::string TypeAsString() const; |
| 68 std::string extra() const { return extra_; } | 68 std::string extra() const { return extra_; } |
| 69 | 69 |
| 70 protected: | 70 protected: |
| 71 virtual ~APIAction(); | 71 virtual ~APIAction(); |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 Type type_; | 74 Type type_; |
| 75 std::string api_call_; | 75 std::string api_call_; |
| 76 std::string args_; | 76 std::string args_; |
| 77 std::string extra_; | 77 std::string extra_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(APIAction); | 79 DISALLOW_COPY_AND_ASSIGN(APIAction); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace extensions | 82 } // namespace extensions |
| 83 | 83 |
| 84 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_API_ACTIONS_H_ | 84 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_API_ACTIONS_H_ |
| OLD | NEW |