OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/api/activity_log_private/activity_log_privat
e_api.h" | 5 #include "chrome/browser/extensions/api/activity_log_private/activity_log_privat
e_api.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // Convert Actions to ExtensionActivities. | 156 // Convert Actions to ExtensionActivities. |
157 std::vector<linked_ptr<ExtensionActivity> > result_arr; | 157 std::vector<linked_ptr<ExtensionActivity> > result_arr; |
158 for (std::vector<scoped_refptr<Action> >::iterator it = activities->begin(); | 158 for (std::vector<scoped_refptr<Action> >::iterator it = activities->begin(); |
159 it != activities->end(); | 159 it != activities->end(); |
160 ++it) { | 160 ++it) { |
161 result_arr.push_back( | 161 result_arr.push_back( |
162 make_linked_ptr(it->get()->ConvertToExtensionActivity().release())); | 162 make_linked_ptr(it->get()->ConvertToExtensionActivity().release())); |
163 } | 163 } |
164 | 164 |
165 // Populate the return object. | 165 // Populate the return object. |
166 // TODO(felt): Implement paging. Right now max_time and more_results are | |
167 // placeholder values. | |
168 scoped_ptr<ActivityResultSet> result_set(new ActivityResultSet); | 166 scoped_ptr<ActivityResultSet> result_set(new ActivityResultSet); |
169 result_set->activities = result_arr; | 167 result_set->activities = result_arr; |
170 result_set->max_time = scoped_ptr<int>(new int(0)); | |
171 result_set->more_results = false; | |
172 results_ = activity_log_private::GetExtensionActivities::Results::Create( | 168 results_ = activity_log_private::GetExtensionActivities::Results::Create( |
173 *result_set); | 169 *result_set); |
174 | 170 |
175 SendResponse(true); | 171 SendResponse(true); |
176 } | 172 } |
177 | 173 |
178 } // namespace extensions | 174 } // namespace extensions |
OLD | NEW |