| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 ++it2) { | 407 ++it2) { |
| 408 action->mutable_args()->AppendString(*it2); | 408 action->mutable_args()->AppendString(*it2); |
| 409 } | 409 } |
| 410 LogAction(action); | 410 LogAction(action); |
| 411 } | 411 } |
| 412 } | 412 } |
| 413 } | 413 } |
| 414 | 414 |
| 415 // LOOKUP ACTIONS. ------------------------------------------------------------- | 415 // LOOKUP ACTIONS. ------------------------------------------------------------- |
| 416 | 416 |
| 417 void ActivityLog::GetActions( | |
| 418 const std::string& extension_id, | |
| 419 const int day, | |
| 420 const base::Callback | |
| 421 <void(scoped_ptr<std::vector<scoped_refptr<Action> > >)>& callback) { | |
| 422 if (policy_) { | |
| 423 policy_->ReadData(extension_id, day, callback); | |
| 424 } | |
| 425 } | |
| 426 | |
| 427 void ActivityLog::GetFilteredActions( | 417 void ActivityLog::GetFilteredActions( |
| 428 const std::string& extension_id, | 418 const std::string& extension_id, |
| 429 const Action::ActionType type, | 419 const Action::ActionType type, |
| 430 const std::string& api_name, | 420 const std::string& api_name, |
| 431 const std::string& page_url, | 421 const std::string& page_url, |
| 432 const std::string& arg_url, | 422 const std::string& arg_url, |
| 423 const int daysAgo, |
| 433 const base::Callback | 424 const base::Callback |
| 434 <void(scoped_ptr<std::vector<scoped_refptr<Action> > >)>& callback) { | 425 <void(scoped_ptr<std::vector<scoped_refptr<Action> > >)>& callback) { |
| 435 if (policy_) { | 426 if (policy_) { |
| 436 policy_->ReadFilteredData( | 427 policy_->ReadFilteredData( |
| 437 extension_id, type, api_name, page_url, arg_url, callback); | 428 extension_id, type, api_name, page_url, arg_url, daysAgo, callback); |
| 438 } | 429 } |
| 439 } | 430 } |
| 440 | 431 |
| 441 // DELETE ACTIONS. ------------------------------------------------------------- | 432 // DELETE ACTIONS. ------------------------------------------------------------- |
| 442 | 433 |
| 443 void ActivityLog::RemoveURLs(const std::vector<GURL>& restrict_urls) { | 434 void ActivityLog::RemoveURLs(const std::vector<GURL>& restrict_urls) { |
| 444 if (!policy_) | 435 if (!policy_) |
| 445 return; | 436 return; |
| 446 policy_->RemoveURLs(restrict_urls); | 437 policy_->RemoveURLs(restrict_urls); |
| 447 } | 438 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 466 RemoveURLs(urls); | 457 RemoveURLs(urls); |
| 467 } | 458 } |
| 468 | 459 |
| 469 void ActivityLog::DeleteDatabase() { | 460 void ActivityLog::DeleteDatabase() { |
| 470 if (!policy_) | 461 if (!policy_) |
| 471 return; | 462 return; |
| 472 policy_->DeleteDatabase(); | 463 policy_->DeleteDatabase(); |
| 473 } | 464 } |
| 474 | 465 |
| 475 } // namespace extensions | 466 } // namespace extensions |
| OLD | NEW |