| 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 "chrome/browser/extensions/activity_log/activity_actions.h" | 5 #include "chrome/browser/extensions/activity_log/activity_actions.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // converting logging to using the types from | 198 // converting logging to using the types from |
| 199 // BlockedChromeActivityDetail::Reason. | 199 // BlockedChromeActivityDetail::Reason. |
| 200 details->reason = BlockedChromeActivityDetail::REASON_NONE; | 200 details->reason = BlockedChromeActivityDetail::REASON_NONE; |
| 201 | 201 |
| 202 result->activity_type = ExtensionActivity::ACTIVITY_TYPE_BLOCKED_CHROME; | 202 result->activity_type = ExtensionActivity::ACTIVITY_TYPE_BLOCKED_CHROME; |
| 203 result->blocked_chrome_activity_detail.reset(details); | 203 result->blocked_chrome_activity_detail.reset(details); |
| 204 break; | 204 break; |
| 205 } | 205 } |
| 206 | 206 |
| 207 case ACTION_DOM_EVENT: | 207 case ACTION_DOM_EVENT: |
| 208 case ACTION_DOM_XHR: | |
| 209 case ACTION_DOM_ACCESS: | 208 case ACTION_DOM_ACCESS: |
| 210 case ACTION_CONTENT_SCRIPT: | 209 case ACTION_CONTENT_SCRIPT: |
| 211 case ACTION_WEB_REQUEST: { | 210 case ACTION_WEB_REQUEST: { |
| 212 DomActivityDetail* details = new DomActivityDetail; | 211 DomActivityDetail* details = new DomActivityDetail; |
| 213 | 212 |
| 214 if (action_type() == ACTION_WEB_REQUEST) { | 213 if (action_type() == ACTION_WEB_REQUEST) { |
| 215 details->dom_activity_type = | 214 details->dom_activity_type = |
| 216 DomActivityDetail::DOM_ACTIVITY_TYPE_WEBREQUEST; | 215 DomActivityDetail::DOM_ACTIVITY_TYPE_WEBREQUEST; |
| 217 } else if (action_type() == ACTION_CONTENT_SCRIPT) { | 216 } else if (action_type() == ACTION_CONTENT_SCRIPT) { |
| 218 details->dom_activity_type = | 217 details->dom_activity_type = |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 break; | 260 break; |
| 262 case ACTION_CONTENT_SCRIPT: | 261 case ACTION_CONTENT_SCRIPT: |
| 263 result += "content_script"; | 262 result += "content_script"; |
| 264 break; | 263 break; |
| 265 case ACTION_API_BLOCKED: | 264 case ACTION_API_BLOCKED: |
| 266 result += "api_blocked"; | 265 result += "api_blocked"; |
| 267 break; | 266 break; |
| 268 case ACTION_DOM_EVENT: | 267 case ACTION_DOM_EVENT: |
| 269 result += "dom_event"; | 268 result += "dom_event"; |
| 270 break; | 269 break; |
| 271 case ACTION_DOM_XHR: | |
| 272 result += "dom_xhr"; | |
| 273 break; | |
| 274 case ACTION_DOM_ACCESS: | 270 case ACTION_DOM_ACCESS: |
| 275 result += "dom_access"; | 271 result += "dom_access"; |
| 276 break; | 272 break; |
| 277 default: | 273 default: |
| 278 result += base::StringPrintf("type%d", static_cast<int>(action_type_)); | 274 result += base::StringPrintf("type%d", static_cast<int>(action_type_)); |
| 279 } | 275 } |
| 280 | 276 |
| 281 result += " API=" + api_name_; | 277 result += " API=" + api_name_; |
| 282 if (args_.get()) { | 278 if (args_.get()) { |
| 283 result += " ARGS=" + Serialize(args_.get()); | 279 result += " ARGS=" + Serialize(args_.get()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 299 result += " ARG_URL=" + arg_url_.spec(); | 295 result += " ARG_URL=" + arg_url_.spec(); |
| 300 } | 296 } |
| 301 if (other_.get()) { | 297 if (other_.get()) { |
| 302 result += " OTHER=" + Serialize(other_.get()); | 298 result += " OTHER=" + Serialize(other_.get()); |
| 303 } | 299 } |
| 304 | 300 |
| 305 return result; | 301 return result; |
| 306 } | 302 } |
| 307 | 303 |
| 308 } // namespace extensions | 304 } // namespace extensions |
| OLD | NEW |