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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 return RespondNow(NoArguments()); | 202 return RespondNow(NoArguments()); |
203 } | 203 } |
204 | 204 |
205 ExtensionFunction::ResponseAction ActivityLogPrivateDeleteUrlsFunction::Run() { | 205 ExtensionFunction::ResponseAction ActivityLogPrivateDeleteUrlsFunction::Run() { |
206 std::unique_ptr<activity_log_private::DeleteUrls::Params> params( | 206 std::unique_ptr<activity_log_private::DeleteUrls::Params> params( |
207 activity_log_private::DeleteUrls::Params::Create(*args_)); | 207 activity_log_private::DeleteUrls::Params::Create(*args_)); |
208 EXTENSION_FUNCTION_VALIDATE(params.get()); | 208 EXTENSION_FUNCTION_VALIDATE(params.get()); |
209 | 209 |
210 // Put the arguments in the right format. | 210 // Put the arguments in the right format. |
211 std::vector<GURL> gurls; | 211 std::vector<GURL> gurls; |
212 std::vector<std::string> urls = *params->urls.get(); | 212 const std::vector<std::string>& urls = *params->urls; |
213 for (std::vector<std::string>::iterator it = urls.begin(); | 213 for (const std::string& url : urls) |
214 it != urls.end(); | 214 gurls.push_back(GURL(url)); |
215 ++it) { | |
216 gurls.push_back(GURL(*it)); | |
217 } | |
218 | 215 |
219 ActivityLog* activity_log = ActivityLog::GetInstance(browser_context()); | 216 ActivityLog* activity_log = ActivityLog::GetInstance(browser_context()); |
220 DCHECK(activity_log); | 217 DCHECK(activity_log); |
221 activity_log->RemoveURLs(gurls); | 218 activity_log->RemoveURLs(gurls); |
222 return RespondNow(NoArguments()); | 219 return RespondNow(NoArguments()); |
223 } | 220 } |
224 | 221 |
225 } // namespace extensions | 222 } // namespace extensions |
OLD | NEW |