summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history/history.h
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-27 03:27:46 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-27 03:27:46 +0000
commit90ef1313cb672e7da91312c4f7d3cdee41c7a767 (patch)
treeb42df35c8c71ca921bf7900beb537a1773debacf /chrome/browser/history/history.h
parent7459794d5e6251014e322a4042d68c4f3f19a5f3 (diff)
downloadchromium_src-90ef1313cb672e7da91312c4f7d3cdee41c7a767.zip
chromium_src-90ef1313cb672e7da91312c4f7d3cdee41c7a767.tar.gz
chromium_src-90ef1313cb672e7da91312c4f7d3cdee41c7a767.tar.bz2
Makes deleting history no longer delete starred urls. Thiseffectively reenables the code in ExpireHistoryBackend. I also madethe code consistent so that when we delete visits as the result ofhistory deletion we don't change the typed/visit count of theunderlying url.BUG=1214201 1256202TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1423 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/history.h')
-rw-r--r--chrome/browser/history/history.h52
1 files changed, 30 insertions, 22 deletions
diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h
index ec42335..74ef67b 100644
--- a/chrome/browser/history/history.h
+++ b/chrome/browser/history/history.h
@@ -25,7 +25,7 @@
#include "chrome/common/page_transition_types.h"
#include "chrome/common/ref_counted_util.h"
-class BookmarkBarModel;
+class BookmarkService;
struct DownloadCreateInfo;
class GURL;
class HistoryURLProvider;
@@ -98,8 +98,12 @@ class HistoryService : public CancelableRequestProvider,
// Initializes the history service, returning true on success. On false, do
// not call any other functions. The given directory will be used for storing
- // the history files.
- bool Init(const std::wstring& history_dir);
+ // the history files. The BookmarkService is used when deleting URLs to
+ // test if a URL is bookmarked; it may be NULL during testing.
+ bool Init(const std::wstring& history_dir, BookmarkService* bookmark_service);
+
+ // Did the backend finish loading the databases?
+ bool backend_loaded() const { return backend_loaded_; }
// Called on shutdown, this will tell the history backend to complete and
// will release pointers to it. No other functions should be called once
@@ -487,6 +491,11 @@ class HistoryService : public CancelableRequestProvider,
CancelableRequestConsumerBase* consumer,
GetMostRecentKeywordSearchTermsCallback* callback);
+ // Bookmarks -----------------------------------------------------------------
+
+ // Notification that a URL is no longer bookmarked.
+ void URLsNoLongerBookmarked(const std::set<GURL>& urls);
+
// Generic Stuff -------------------------------------------------------------
typedef Callback0::Type HistoryDBTaskCallback;
@@ -496,13 +505,6 @@ class HistoryService : public CancelableRequestProvider,
Handle ScheduleDBTask(HistoryDBTask* task,
CancelableRequestConsumerBase* consumer);
- typedef Callback0::Type EmptyHistoryCallback;
-
- // Schedules a task that does nothing on the backend. This can be used to get
- // notification when then history backend is done processing requests.
- Handle ScheduleEmptyCallback(CancelableRequestConsumerBase* consumer,
- EmptyHistoryCallback* callback);
-
// Testing -------------------------------------------------------------------
// Designed for unit tests, this passes the given task on to the history
@@ -536,6 +538,16 @@ class HistoryService : public CancelableRequestProvider,
private:
class BackendDelegate;
friend class BackendDelegate;
+ friend class history::HistoryBackend;
+ friend class history::HistoryQueryTest;
+ friend class HistoryOperation;
+ friend class HistoryURLProvider;
+ friend class HistoryURLProviderTest;
+ template<typename Info, typename Callback> friend class DownloadRequest;
+ friend class PageUsageRequest;
+ friend class RedirectRequest;
+ friend class FavIconRequest;
+ friend class TestingProfile;
// These are not currently used, hopefully we can do something in the future
// to ensure that the most important things happen first.
@@ -545,17 +557,6 @@ class HistoryService : public CancelableRequestProvider,
PRIORITY_LOW, // Low priority things like indexing or expiration.
};
- friend class BookmarkBarModel;
- friend class HistoryURLProvider;
- friend class history::HistoryBackend;
- template<typename Info, typename Callback> friend class DownloadRequest;
- friend class PageUsageRequest;
- friend class RedirectRequest;
- friend class FavIconRequest;
- friend class history::HistoryQueryTest;
- friend class HistoryOperation;
- friend class HistoryURLProviderTest;
-
// Implementation of NotificationObserver.
virtual void Observe(NotificationType type,
const NotificationSource& source,
@@ -577,6 +578,10 @@ class HistoryService : public CancelableRequestProvider,
void BroadcastNotifications(NotificationType type,
history::HistoryDetails* details_deleted);
+ // Notification from the backend that it has finished loading. Sends
+ // notification (NOTIFY_HISTORY_LOADED) and sets backend_loaded_ to true.
+ void OnDBLoaded();
+
// Returns true if this looks like the type of URL we want to add to the
// history. We filter out some URLs such as JavaScript.
bool CanAddURL(const GURL& url) const;
@@ -747,8 +752,11 @@ class HistoryService : public CancelableRequestProvider,
// The profile, may be null when testing.
Profile* profile_;
+ // Has the backend finished loading? The backend is loaded once Init has
+ // completed.
+ bool backend_loaded_;
+
DISALLOW_EVIL_CONSTRUCTORS(HistoryService);
};
#endif // CHROME_BROWSER_HISTORY_HISTORY_H__
-