summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks/bookmark_model.h
diff options
context:
space:
mode:
authormunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-28 20:23:33 +0000
committermunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-28 20:23:33 +0000
commitfc7c36a2c51aeba1da2495ffa5f6944179b93974 (patch)
tree909b0fa25ab0c23c1157af27515927e3a426fba3 /chrome/browser/bookmarks/bookmark_model.h
parent1e7377df1449c4e543a50c8a8a1425599c8425f7 (diff)
downloadchromium_src-fc7c36a2c51aeba1da2495ffa5f6944179b93974.zip
chromium_src-fc7c36a2c51aeba1da2495ffa5f6944179b93974.tar.gz
chromium_src-fc7c36a2c51aeba1da2495ffa5f6944179b93974.tar.bz2
We need to save bookmarks file when the persist_ids settings changes
or when the file is detected to be changed externally. Review URL: http://codereview.chromium.org/114055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_model.h')
-rw-r--r--chrome/browser/bookmarks/bookmark_model.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h
index 669a0b5..d00e7c6 100644
--- a/chrome/browser/bookmarks/bookmark_model.h
+++ b/chrome/browser/bookmarks/bookmark_model.h
@@ -328,6 +328,9 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
bool PersistIDs() const { return persist_ids_; }
void SetPersistIDs(bool value);
+ // Returns whether the bookmarks file changed externally.
+ bool file_changed() const { return file_changed_; }
+
private:
// Used to order BookmarkNodes by URL.
class NodeURLComparator {
@@ -418,6 +421,9 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
// persisted.
void set_next_node_id(int id) { next_node_id_ = id; }
+ // Records that the bookmarks file was changed externally.
+ void SetFileChanged();
+
// Creates and returns a new LoadDetails. It's up to the caller to delete
// the returned object.
BookmarkStorage::LoadDetails* CreateLoadDetails();
@@ -437,6 +443,10 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
// Whether to persist bookmark IDs.
bool persist_ids_;
+ // Whether the bookmarks file was changed externally. This is set after
+ // loading is complete and once set the value never changes.
+ bool file_changed_;
+
// The root node. This contains the bookmark bar node and the 'other' node as
// children.
BookmarkNode root_;