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 | 406 |
407 // static | 407 // static |
408 void ActivityLog::RegisterProfilePrefs( | 408 void ActivityLog::RegisterProfilePrefs( |
409 user_prefs::PrefRegistrySyncable* registry) { | 409 user_prefs::PrefRegistrySyncable* registry) { |
410 registry->RegisterBooleanPref( | 410 registry->RegisterBooleanPref( |
411 prefs::kWatchdogExtensionActive, | 411 prefs::kWatchdogExtensionActive, |
412 false, | 412 false, |
413 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 413 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
414 } | 414 } |
415 | 415 |
| 416 void ActivityLog::RemoveURLs(const std::vector<GURL>& restrict_urls) { |
| 417 if (!IsLogEnabled()) { |
| 418 DLOG(INFO) << "Log not enabled for this profile."; |
| 419 return; |
| 420 } |
| 421 policy_->RemoveURLs(restrict_urls); |
| 422 } |
| 423 |
| 424 void ActivityLog::RemoveURLs(const std::set<GURL>& restrict_urls) { |
| 425 if (!IsLogEnabled()) { |
| 426 DLOG(INFO) << "Log not enabled for this profile."; |
| 427 return; |
| 428 } |
| 429 |
| 430 std::vector<GURL> urls; |
| 431 for (std::set<GURL>::iterator it = restrict_urls.begin(); |
| 432 it != restrict_urls.end(); ++it) { |
| 433 urls.push_back(*it); |
| 434 } |
| 435 policy_->RemoveURLs(urls); |
| 436 } |
| 437 |
| 438 void ActivityLog::RemoveURL(const GURL& url) { |
| 439 if (url.is_empty()) |
| 440 return; |
| 441 std::vector<GURL> urls; |
| 442 urls.push_back(url); |
| 443 RemoveURLs(urls); |
| 444 } |
| 445 |
416 } // namespace extensions | 446 } // namespace extensions |
OLD | NEW |