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

Unified Diff: chrome/browser/extensions/url_actions.cc

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/url_actions.cc
===================================================================
--- chrome/browser/extensions/url_actions.cc (revision 0)
+++ chrome/browser/extensions/url_actions.cc (revision 0)
@@ -0,0 +1,63 @@
+// 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.
+
+#include "chrome/browser/extensions/url_actions.h"
+#include "rlz/lib/assert.h"
+
+namespace activity {
+
+UrlAction::UrlAction(const std::string& extension_id,
+ const UrlActionType& verb,
+ const GURL& url,
+ const string16& url_title,
+ const std::string& api_call,
+ const base::Time& time)
+ : extension_id_(extension_id),
+ verb_(verb),
+ url_(url),
+ url_title_(url_title),
+ api_call_(api_call),
+ time_(time) { }
+
+std::string UrlAction::PrettyPrintForil8n() {
+ // TODO(felt): implement this.
+ return "hi";
+}
+
+std::string UrlAction::PrettyPrintForDebug() {
+ // TODO(felt): implement this.
+ return "hi";
+}
+
+std::string UrlAction::VerbAsString() {
+ switch (verb_) {
+ case MODIFIED:
+ return "MODIFIED";
+ case READ:
+ return "READ";
+ case INSERTED:
+ return "INSERTED";
+ case XHR:
+ return "XHR";
+ default:
+ return "UNKNOWN";
+ }
+}
+
+UrlAction::UrlActionType UrlAction::StringAsUrlActionType(
+ const std::string& str) {
+ if (str == "MODIFIED") {
+ return MODIFIED;
+ } else if (str == "READ") {
+ return READ;
+ } else if (str == "INSERTED") {
+ return INSERTED;
+ } else if (str == "XHR") {
+ return XHR;
+ } else {
+ return UNKNOWN; // this should never happen!
+ }
+}
+
+} // namespace
« chrome/browser/extensions/url_actions.h ('K') | « chrome/browser/extensions/url_actions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698