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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 break; | 161 break; |
162 } | 162 } |
163 | 163 |
164 result->extension_id.reset(new std::string(extension_id())); | 164 result->extension_id.reset(new std::string(extension_id())); |
165 result->time.reset(new double(time().ToJsTime())); | 165 result->time.reset(new double(time().ToJsTime())); |
166 result->api_call.reset(new std::string(api_name())); | 166 result->api_call.reset(new std::string(api_name())); |
167 result->args.reset(new std::string(Serialize(args()))); | 167 result->args.reset(new std::string(Serialize(args()))); |
168 if (page_url().is_valid()) { | 168 if (page_url().is_valid()) { |
169 if (!page_title().empty()) | 169 if (!page_title().empty()) |
170 result->page_title.reset(new std::string(page_title())); | 170 result->page_title.reset(new std::string(page_title())); |
171 result->page_url.reset(new std::string(page_url().spec())); | 171 result->page_url.reset(new std::string(SerializePageUrl())); |
172 } | 172 } |
173 if (arg_url().is_valid()) | 173 if (arg_url().is_valid()) |
174 result->arg_url.reset(new std::string(arg_url().spec())); | 174 result->arg_url.reset(new std::string(SerializeArgUrl())); |
175 result->extra.reset(new std::string(Serialize(other()))); | 175 result->extra.reset(new std::string(Serialize(other()))); |
176 | 176 |
177 return result.Pass(); | 177 return result.Pass(); |
178 } | 178 } |
179 | 179 |
180 std::string Action::PrintForDebug() const { | 180 std::string Action::PrintForDebug() const { |
181 std::string result = "ID=" + extension_id() + " CATEGORY="; | 181 std::string result = "ID=" + extension_id() + " CATEGORY="; |
182 switch (action_type_) { | 182 switch (action_type_) { |
183 case ACTION_API_CALL: | 183 case ACTION_API_CALL: |
184 result += "api_call"; | 184 result += "api_call"; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 std::string rhs_other = ActivityLogPolicy::Util::Serialize(rhs->other()); | 289 std::string rhs_other = ActivityLogPolicy::Util::Serialize(rhs->other()); |
290 if (lhs_other != rhs_other) | 290 if (lhs_other != rhs_other) |
291 return lhs_other < rhs_other; | 291 return lhs_other < rhs_other; |
292 } | 292 } |
293 | 293 |
294 // All fields compare as equal if this point is reached. | 294 // All fields compare as equal if this point is reached. |
295 return false; | 295 return false; |
296 } | 296 } |
297 | 297 |
298 } // namespace extensions | 298 } // namespace extensions |
OLD | NEW |