OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // User of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/extensions/url_actions.h" |
| 6 #include "rlz/lib/assert.h" |
| 7 |
| 8 namespace activity { |
| 9 |
| 10 UrlAction::UrlAction(const std::string& extension_id, |
| 11 const UrlActionType& verb, |
| 12 const GURL& url, |
| 13 const string16& url_title, |
| 14 const std::string& api_call, |
| 15 const base::Time& time) |
| 16 : extension_id_(extension_id), |
| 17 verb_(verb), |
| 18 url_(url), |
| 19 url_title_(url_title), |
| 20 api_call_(api_call), |
| 21 time_(time) { } |
| 22 |
| 23 std::string UrlAction::PrettyPrintForil8n() { |
| 24 // TODO(felt): implement this. |
| 25 return "hi"; |
| 26 } |
| 27 |
| 28 std::string UrlAction::PrettyPrintForDebug() { |
| 29 // TODO(felt): implement this. |
| 30 return "hi"; |
| 31 } |
| 32 |
| 33 std::string UrlAction::VerbAsString() { |
| 34 switch (verb_) { |
| 35 case MODIFIED: |
| 36 return "MODIFIED"; |
| 37 case READ: |
| 38 return "READ"; |
| 39 case INSERTED: |
| 40 return "INSERTED"; |
| 41 case XHR: |
| 42 return "XHR"; |
| 43 default: |
| 44 return "UNKNOWN"; |
| 45 } |
| 46 } |
| 47 |
| 48 UrlAction::UrlActionType UrlAction::StringAsUrlActionType( |
| 49 const std::string& str) { |
| 50 if (str == "MODIFIED") { |
| 51 return MODIFIED; |
| 52 } else if (str == "READ") { |
| 53 return READ; |
| 54 } else if (str == "INSERTED") { |
| 55 return INSERTED; |
| 56 } else if (str == "XHR") { |
| 57 return XHR; |
| 58 } else { |
| 59 return UNKNOWN; // this should never happen! |
| 60 } |
| 61 } |
| 62 |
| 63 } // namespace |
OLD | NEW |