Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5101)

Unified Diff: chrome/browser/extensions/api_actions.h

Issue 11946028: Record event activity to the extension activity log. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api_actions.h
diff --git a/chrome/browser/extensions/api_actions.h b/chrome/browser/extensions/api_actions.h
index 3cbd5ff15a9ac3c1156830eddecfc1f4811eeb6d..2dca5194ca979b38b86af1d8faa21fca49bf6978 100644
--- a/chrome/browser/extensions/api_actions.h
+++ b/chrome/browser/extensions/api_actions.h
@@ -15,6 +15,14 @@ namespace extensions {
// problems. See BlockedActions for API calls that did not succeed.
class APIAction : public Action {
public:
+ // TODO(mvrable): Come up with a good name for this; I'm not entirely happy
+ // with APICategory but "type" is already used.
+ enum APICategory {
+ CALL,
+ EVENT_CALLBACK,
+ UNKNOWN_CATEGORY
+ };
+
// TODO(felt): I'll finalize this list when making the UI.
enum APIActionType {
READ,
@@ -46,6 +54,7 @@ class APIAction : public Action {
// parameters are required.
APIAction(const std::string& extension_id,
const base::Time& time,
+ const APICategory category, // e.g. "CALL"
const APIActionType verb, // e.g. "ADDED"
const APITargetType target, // e.g. "BOOKMARK"
const std::string& api_call, // full method signature incl args
@@ -64,11 +73,13 @@ class APIAction : public Action {
const std::string& extension_id() const { return extension_id_; }
const base::Time& time() const { return time_; }
const std::string& api_call() const { return api_call_; }
+ std::string CategoryAsString() const;
std::string VerbAsString() const;
std::string TargetAsString() const;
std::string extra() const { return extra_; }
// Helper methods for creating a APIAction.
+ static APICategory StringAsCategory(const std::string& str);
static APIActionType StringAsActionType(const std::string& str);
static APITargetType StringAsTargetType(const std::string& str);
@@ -78,6 +89,7 @@ class APIAction : public Action {
private:
std::string extension_id_;
base::Time time_;
+ APICategory category_;
APIActionType verb_;
APITargetType target_;
std::string api_call_;

Powered by Google App Engine
This is Rietveld 408576698