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/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 default: | 233 default: |
234 other_field->dom_verb = | 234 other_field->dom_verb = |
235 activity_log::EXTENSION_ACTIVITY_DOM_VERB_NONE; | 235 activity_log::EXTENSION_ACTIVITY_DOM_VERB_NONE; |
236 } | 236 } |
237 } else { | 237 } else { |
238 other_field->dom_verb = activity_log::EXTENSION_ACTIVITY_DOM_VERB_NONE; | 238 other_field->dom_verb = activity_log::EXTENSION_ACTIVITY_DOM_VERB_NONE; |
239 } | 239 } |
240 result->other.reset(other_field.release()); | 240 result->other.reset(other_field.release()); |
241 } | 241 } |
242 | 242 |
243 return result.Pass(); | 243 return result; |
244 } | 244 } |
245 | 245 |
246 std::string Action::PrintForDebug() const { | 246 std::string Action::PrintForDebug() const { |
247 std::string result = base::StringPrintf("ACTION ID=%" PRId64, action_id()); | 247 std::string result = base::StringPrintf("ACTION ID=%" PRId64, action_id()); |
248 result += " EXTENSION ID=" + extension_id() + " CATEGORY="; | 248 result += " EXTENSION ID=" + extension_id() + " CATEGORY="; |
249 switch (action_type_) { | 249 switch (action_type_) { |
250 case ACTION_API_CALL: | 250 case ACTION_API_CALL: |
251 result += "api_call"; | 251 result += "api_call"; |
252 break; | 252 break; |
253 case ACTION_API_EVENT: | 253 case ACTION_API_EVENT: |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 std::string rhs_other = ActivityLogPolicy::Util::Serialize(rhs->other()); | 359 std::string rhs_other = ActivityLogPolicy::Util::Serialize(rhs->other()); |
360 if (lhs_other != rhs_other) | 360 if (lhs_other != rhs_other) |
361 return lhs_other < rhs_other; | 361 return lhs_other < rhs_other; |
362 } | 362 } |
363 | 363 |
364 // All fields compare as equal if this point is reached. | 364 // All fields compare as equal if this point is reached. |
365 return false; | 365 return false; |
366 } | 366 } |
367 | 367 |
368 } // namespace extensions | 368 } // namespace extensions |
OLD | NEW |