diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-16 00:08:10 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-16 00:08:10 +0000 |
commit | eea8fd55353c798c2e58351be37dec3b5d69595b (patch) | |
tree | 46f763cb882c87cff04d1a8abca1e25a747c0957 | |
parent | 972e6c32bb7370959b752ba28da9ff4b3f663bbc (diff) | |
download | chromium_src-eea8fd55353c798c2e58351be37dec3b5d69595b.zip chromium_src-eea8fd55353c798c2e58351be37dec3b5d69595b.tar.gz chromium_src-eea8fd55353c798c2e58351be37dec3b5d69595b.tar.bz2 |
Lands http://codereview.chromium.org/469009 for Thiago:
bookmarks: Update parent (folder) modified time when we create a new
bookmark node.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/500005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34626 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model.cc | 18 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model.h | 6 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_utils.cc | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index f75577c..a4e17dc 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -389,6 +389,15 @@ void BookmarkModel::SetURLStarred(const GURL& url, } } +void BookmarkModel::SetDateGroupModified(const BookmarkNode* parent, + const Time time) { + DCHECK(parent); + AsMutable(parent)->set_date_group_modified(time); + + if (store_.get()) + store_->ScheduleSave(); +} + void BookmarkModel::ResetDateGroupModified(const BookmarkNode* node) { SetDateGroupModified(node, Time()); } @@ -603,15 +612,6 @@ bool BookmarkModel::IsValidIndex(const BookmarkNode* parent, (allow_end && index == parent->GetChildCount())))); } -void BookmarkModel::SetDateGroupModified(const BookmarkNode* parent, - const Time time) { - DCHECK(parent); - AsMutable(parent)->set_date_group_modified(time); - - if (store_.get()) - store_->ScheduleSave(); -} - BookmarkNode* BookmarkModel::CreateBookmarkNode() { history::StarredEntry entry; entry.type = history::StarredEntry::BOOKMARK_BAR; diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index 5d03af7..ba66791 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -274,6 +274,9 @@ class BookmarkModel : public NotificationObserver, public BookmarkService { const std::wstring& title, bool is_starred); + // Sets the date modified time of the specified node. + void SetDateGroupModified(const BookmarkNode* parent, const base::Time time); + // Resets the 'date modified' time of the node to 0. This is used during // importing to exclude the newly created groups from showing up in the // combobox of most recently modified groups. @@ -356,9 +359,6 @@ class BookmarkModel : public NotificationObserver, public BookmarkService { // Returns true if the parent and index are valid. bool IsValidIndex(const BookmarkNode* parent, int index, bool allow_end); - // Sets the date modified time of the specified node. - void SetDateGroupModified(const BookmarkNode* parent, const base::Time time); - // Creates the bookmark bar/other nodes. These call into // CreateRootNodeFromStarredEntry. BookmarkNode* CreateBookmarkNode(); diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index e62a30a..b682c2b 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -519,7 +519,7 @@ static const BookmarkNode* CreateNewNode(BookmarkModel* model, model->AddURL(node, node->GetChildCount(), details.urls[i].second, details.urls[i].first); } - // TODO(sky): update parent modified time. + model->SetDateGroupModified(parent, Time::Now()); } else { NOTREACHED(); return NULL; |