diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 08:15:53 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 08:15:53 +0000 |
commit | 21f4d251210a4408da8a3279510ef7eb44cc1e1a (patch) | |
tree | a235ca4b807641d671b244fc78ed9bb64205b4ac /chrome/browser/history/text_database_manager.cc | |
parent | 0c86dbf56c6f3e82ee748f34dca48aedf962dec2 (diff) | |
download | chromium_src-21f4d251210a4408da8a3279510ef7eb44cc1e1a.zip chromium_src-21f4d251210a4408da8a3279510ef7eb44cc1e1a.tar.gz chromium_src-21f4d251210a4408da8a3279510ef7eb44cc1e1a.tar.bz2 |
Implement edit mode for history page.
BUG=35338
TEST=none
Review URL: http://codereview.chromium.org/660283
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40722 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/text_database_manager.cc')
-rw-r--r-- | chrome/browser/history/text_database_manager.cc | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/chrome/browser/history/text_database_manager.cc b/chrome/browser/history/text_database_manager.cc index 149cd72..0b27203 100644 --- a/chrome/browser/history/text_database_manager.cc +++ b/chrome/browser/history/text_database_manager.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -337,7 +337,8 @@ void TextDatabaseManager::DeletePageData(Time time, const GURL& url, db->DeletePageData(time, URLDatabase::GURLToDatabaseURL(url)); } -void TextDatabaseManager::DeleteFromUncommitted(Time begin, Time end) { +void TextDatabaseManager::DeleteFromUncommitted( + const std::set<GURL>& restrict_urls, Time begin, Time end) { // First find the beginning of the range to delete. Recall that the list // has the most recent item at the beginning. There won't normally be very // many items, so a brute-force search is fine. @@ -352,15 +353,17 @@ void TextDatabaseManager::DeleteFromUncommitted(Time begin, Time end) { // Now delete all visits up to the oldest one we were supposed to delete. // Note that if begin is_null, it will be less than or equal to any other // time. - while (cur != recent_changes_.end() && cur->second.visit_time() >= begin) - cur = recent_changes_.Erase(cur); -} - -void TextDatabaseManager::DeleteURLFromUncommitted(const GURL& url) { - RecentChangeList::iterator found = recent_changes_.Peek(url); - if (found == recent_changes_.end()) - return; // We don't know about this page, give up. - recent_changes_.Erase(found); + if (restrict_urls.empty()) { + while (cur != recent_changes_.end() && cur->second.visit_time() >= begin) + cur = recent_changes_.Erase(cur); + } else { + while (cur != recent_changes_.end() && cur->second.visit_time() >= begin) { + if (restrict_urls.find(cur->first) != restrict_urls.end()) + cur = recent_changes_.Erase(cur); + else + ++cur; + } + } } void TextDatabaseManager::DeleteAll() { |