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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 420 |
421 // static | 421 // static |
422 void ActivityLog::RegisterProfilePrefs( | 422 void ActivityLog::RegisterProfilePrefs( |
423 user_prefs::PrefRegistrySyncable* registry) { | 423 user_prefs::PrefRegistrySyncable* registry) { |
424 registry->RegisterBooleanPref( | 424 registry->RegisterBooleanPref( |
425 prefs::kWatchdogExtensionActive, | 425 prefs::kWatchdogExtensionActive, |
426 false, | 426 false, |
427 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 427 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
428 } | 428 } |
429 | 429 |
| 430 void ActivityLog::RemoveURLs(const std::vector<GURL>& restrict_urls) { |
| 431 if (!policy_ || !IsLogEnabled()) { |
| 432 return; |
| 433 } |
| 434 policy_->RemoveURLs(restrict_urls); |
| 435 } |
| 436 |
| 437 void ActivityLog::RemoveURLs(const std::set<GURL>& restrict_urls) { |
| 438 if (!policy_ || !IsLogEnabled()) { |
| 439 return; |
| 440 } |
| 441 |
| 442 std::vector<GURL> urls; |
| 443 for (std::set<GURL>::const_iterator it = restrict_urls.begin(); |
| 444 it != restrict_urls.end(); ++it) { |
| 445 urls.push_back(*it); |
| 446 } |
| 447 policy_->RemoveURLs(urls); |
| 448 } |
| 449 |
| 450 void ActivityLog::RemoveURL(const GURL& url) { |
| 451 if (url.is_empty()) |
| 452 return; |
| 453 std::vector<GURL> urls; |
| 454 urls.push_back(url); |
| 455 RemoveURLs(urls); |
| 456 } |
| 457 |
430 } // namespace extensions | 458 } // namespace extensions |
OLD | NEW |