OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/logging.h" | 5 #include "base/logging.h" |
6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/dom_actions.h" | 8 #include "chrome/browser/extensions/dom_actions.h" |
9 #include "chrome/browser/history/url_database.h" | 9 #include "chrome/browser/history/url_database.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 std::string DOMAction::VerbAsString() const { | 101 std::string DOMAction::VerbAsString() const { |
102 switch (verb_) { | 102 switch (verb_) { |
103 case MODIFIED: | 103 case MODIFIED: |
104 return "MODIFIED"; | 104 return "MODIFIED"; |
105 case READ: | 105 case READ: |
106 return "READ"; | 106 return "READ"; |
107 case INSERTED: | 107 case INSERTED: |
108 return "INSERTED"; | 108 return "INSERTED"; |
109 case XHR: | 109 case XHR: |
110 return "XHR"; | 110 return "XHR"; |
111 case WEBREQUEST: | |
112 return "WEBREQUEST"; | |
113 default: | 111 default: |
114 NOTREACHED(); | 112 NOTREACHED(); |
115 return NULL; | 113 return NULL; |
116 } | 114 } |
117 } | 115 } |
118 | 116 |
119 DOMAction::DOMActionType DOMAction::StringAsDOMActionType( | 117 DOMAction::DOMActionType DOMAction::StringAsDOMActionType( |
120 const std::string& str) { | 118 const std::string& str) { |
121 if (str == "MODIFIED") { | 119 if (str == "MODIFIED") { |
122 return MODIFIED; | 120 return MODIFIED; |
123 } else if (str == "READ") { | 121 } else if (str == "READ") { |
124 return READ; | 122 return READ; |
125 } else if (str == "INSERTED") { | 123 } else if (str == "INSERTED") { |
126 return INSERTED; | 124 return INSERTED; |
127 } else if (str == "XHR") { | 125 } else if (str == "XHR") { |
128 return XHR; | 126 return XHR; |
129 } else if (str == "WEBREQUEST") { | |
130 return WEBREQUEST; | |
131 } else { | 127 } else { |
132 NOTREACHED(); | 128 NOTREACHED(); |
133 return MODIFIED; // this should never happen! | 129 return MODIFIED; // this should never happen! |
134 } | 130 } |
135 } | 131 } |
136 | 132 |
137 } // namespace extensions | 133 } // namespace extensions |
OLD | NEW |