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

Side by Side Diff: chrome/browser/extensions/dom_actions.cc

Issue 12491012: Improved extension activity logging for the chrome.webRequest API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Simplify code Created 7 years, 8 months 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 unified diff | Download patch
OLDNEW
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
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";
111 default: 113 default:
112 NOTREACHED(); 114 NOTREACHED();
113 return NULL; 115 return NULL;
114 } 116 }
115 } 117 }
116 118
117 DOMAction::DOMActionType DOMAction::StringAsDOMActionType( 119 DOMAction::DOMActionType DOMAction::StringAsDOMActionType(
118 const std::string& str) { 120 const std::string& str) {
119 if (str == "MODIFIED") { 121 if (str == "MODIFIED") {
120 return MODIFIED; 122 return MODIFIED;
121 } else if (str == "READ") { 123 } else if (str == "READ") {
122 return READ; 124 return READ;
123 } else if (str == "INSERTED") { 125 } else if (str == "INSERTED") {
124 return INSERTED; 126 return INSERTED;
125 } else if (str == "XHR") { 127 } else if (str == "XHR") {
126 return XHR; 128 return XHR;
129 } else if (str == "WEBREQUEST") {
130 return WEBREQUEST;
127 } else { 131 } else {
128 NOTREACHED(); 132 NOTREACHED();
129 return MODIFIED; // this should never happen! 133 return MODIFIED; // this should never happen!
130 } 134 }
131 } 135 }
132 136
133 } // namespace extensions 137 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698