Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: chrome/browser/extensions/activity_log/activity_log.cc

Issue 18878009: Add functions to clean URLs from the activity log (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use const_iterator Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/activity_log/activity_log.h ('k') | chrome/browser/extensions/activity_log/activity_log_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698