| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_log.h" | 5 #include "chrome/browser/extensions/activity_log/activity_log.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 ++it2) { | 406 ++it2) { |
| 407 action->mutable_args()->AppendString(*it2); | 407 action->mutable_args()->AppendString(*it2); |
| 408 } | 408 } |
| 409 LogAction(action); | 409 LogAction(action); |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 } | 412 } |
| 413 | 413 |
| 414 // LOOKUP ACTIONS. ------------------------------------------------------------- | 414 // LOOKUP ACTIONS. ------------------------------------------------------------- |
| 415 | 415 |
| 416 void ActivityLog::GetActions( | |
| 417 const std::string& extension_id, | |
| 418 const int day, | |
| 419 const base::Callback | |
| 420 <void(scoped_ptr<std::vector<scoped_refptr<Action> > >)>& callback) { | |
| 421 if (policy_) { | |
| 422 policy_->ReadData(extension_id, day, callback); | |
| 423 } | |
| 424 } | |
| 425 | |
| 426 void ActivityLog::GetFilteredActions( | 416 void ActivityLog::GetFilteredActions( |
| 427 const std::string& extension_id, | 417 const std::string& extension_id, |
| 428 const Action::ActionType type, | 418 const Action::ActionType type, |
| 429 const std::string& api_name, | 419 const std::string& api_name, |
| 430 const std::string& page_url, | 420 const std::string& page_url, |
| 431 const std::string& arg_url, | 421 const std::string& arg_url, |
| 422 const int daysAgo, |
| 432 const base::Callback | 423 const base::Callback |
| 433 <void(scoped_ptr<std::vector<scoped_refptr<Action> > >)>& callback) { | 424 <void(scoped_ptr<std::vector<scoped_refptr<Action> > >)>& callback) { |
| 434 if (policy_) { | 425 if (policy_) { |
| 435 policy_->ReadFilteredData( | 426 policy_->ReadFilteredData( |
| 436 extension_id, type, api_name, page_url, arg_url, callback); | 427 extension_id, type, api_name, page_url, arg_url, daysAgo, callback); |
| 437 } | 428 } |
| 438 } | 429 } |
| 439 | 430 |
| 440 // DELETE ACTIONS. ------------------------------------------------------------- | 431 // DELETE ACTIONS. ------------------------------------------------------------- |
| 441 | 432 |
| 442 void ActivityLog::RemoveURLs(const std::vector<GURL>& restrict_urls) { | 433 void ActivityLog::RemoveURLs(const std::vector<GURL>& restrict_urls) { |
| 443 if (!policy_ || !IsLogEnabled()) { | 434 if (!policy_ || !IsLogEnabled()) { |
| 444 return; | 435 return; |
| 445 } | 436 } |
| 446 policy_->RemoveURLs(restrict_urls); | 437 policy_->RemoveURLs(restrict_urls); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 461 | 452 |
| 462 void ActivityLog::RemoveURL(const GURL& url) { | 453 void ActivityLog::RemoveURL(const GURL& url) { |
| 463 if (url.is_empty()) | 454 if (url.is_empty()) |
| 464 return; | 455 return; |
| 465 std::vector<GURL> urls; | 456 std::vector<GURL> urls; |
| 466 urls.push_back(url); | 457 urls.push_back(url); |
| 467 RemoveURLs(urls); | 458 RemoveURLs(urls); |
| 468 } | 459 } |
| 469 | 460 |
| 470 } // namespace extensions | 461 } // namespace extensions |
| OLD | NEW |