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

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

Issue 11421192: Save extension activity log to a file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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/manager_actions.h
===================================================================
--- chrome/browser/extensions/manager_actions.h (revision 0)
+++ chrome/browser/extensions/manager_actions.h (revision 0)
@@ -0,0 +1,90 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// User of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_MANAGER_ACTIONS_H_
+#define CHROME_BROWSER_EXTENSIONS_MANAGER_ACTIONS_H_
+
+#include <string>
+#include "base/time.h"
+#include "chrome/browser/extensions/activity_actions.h"
+
+namespace extensions {
+
+extern const char* manager_table_name_;
+extern const char* manager_table_structure_;
+
+// This class describes extension actions that pertain to Content Script
Eric Dingle 2012/12/13 20:37:34 This looks like the description for UrlAction. Cop
felt 2012/12/15 02:51:52 Done.
Eric Dingle 2012/12/18 21:55:35 I don't see any changes. Is this the right descrip
felt 2012/12/18 23:28:54 Very odd. Don't know what happened. Fixed.
+// insertion, Content Script DOM manipulations, and extension XHRs.
+class ManagerAction : public Action,
+ public base::RefCountedThreadSafe<ManagerAction> {
+ public:
+ // TODO(felt): I'll finalize this list when making the UI.
+ enum ManagerActionType {
+ READ,
+ MODIFIED,
+ DELETED,
+ ADDED,
+ ENABLED,
+ DISABLED,
+ CREATED,
+ UNKNOWN_ACTION
+ };
+
+ // TODO(felt): I'll finalize this list when making the UI.
+ enum ManagerTargetType {
+ BOOKMARK,
+ TABS,
+ HISTORY,
+ COOKIES,
+ BROWSER_ACTION,
+ NOTIFICATION,
+ OMNIBOX,
+ UNKNOWN_TARGET
+ };
+
+ // Create a new ManagerAction to describe a ContentScript action
+ // or XHR. All of the parameters should have values except for
+ // url_title, which can be an empty string if the ActionType is XHR.
Eric Dingle 2012/12/13 20:37:34 Also looks like it describes the UrlAction constru
felt 2012/12/15 02:51:52 Done.
Eric Dingle 2012/12/18 21:55:35 I don't see any changes.
felt 2012/12/18 23:28:54 Done.
+ ManagerAction(const std::string& extension_id,
+ const ManagerActionType verb,
+ const ManagerTargetType target,
+ const std::string& api_call,
+ const base::Time& time);
+
+ // Print a ManagerAction with il8n substitutions for display.
+ virtual std::string PrettyPrintFori18n() OVERRIDE;
+
+ // Print a ManagerAction as a regular string for debugging purposes.
+ virtual std::string PrettyPrintForDebug() OVERRIDE;
+
+ // Helper methods for recording the values into the db.
+ 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 VerbAsString() const;
+ std::string TargetAsString() const;
+
+ // Helper methods for creating a ManagerAction.
+ static ManagerActionType StringAsActionType(const std::string& str);
+ static ManagerTargetType StringAsTargetType(const std::string& str);
+
+ protected:
+ virtual ~ManagerAction();
+
+ private:
+ friend class base::RefCountedThreadSafe<ManagerAction>;
+
+ std::string extension_id_;
+ ManagerActionType verb_;
+ ManagerTargetType target_;
+ std::string api_call_;
+ base::Time time_;
+
+ DISALLOW_COPY_AND_ASSIGN(ManagerAction);
+};
+
+} // namespace
+
+#endif // CHROME_BROWSER_EXTENSIONS_MANAGER_ACTIONS_H_
+

Powered by Google App Engine
This is Rietveld 408576698