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

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: Added counting policy Created 7 years, 4 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698