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 |