diff options
-rw-r--r-- | chrome/browser/bookmarks/bookmark_codec.cc | 4 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model.cc | 6 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model.h | 29 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model_test_utils.cc | 4 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_utils.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_bookmark_helpers.cc | 2 | ||||
-rw-r--r-- | chrome/browser/history/history_types.cc | 4 | ||||
-rw-r--r-- | chrome/browser/history/history_types.h | 4 | ||||
-rw-r--r-- | chrome/browser/history/starred_url_database.cc | 8 |
9 files changed, 33 insertions, 32 deletions
diff --git a/chrome/browser/bookmarks/bookmark_codec.cc b/chrome/browser/bookmarks/bookmark_codec.cc index fc9c3d9..fa557ea 100644 --- a/chrome/browser/bookmarks/bookmark_codec.cc +++ b/chrome/browser/bookmarks/bookmark_codec.cc @@ -101,7 +101,7 @@ Value* BookmarkCodec::EncodeNode(const BookmarkNode* node) { } else { value->SetString(kTypeKey, kTypeFolder); value->SetString(kDateModifiedKey, - base::Int64ToString(node->date_group_modified(). + base::Int64ToString(node->date_folder_modified(). ToInternalValue())); UpdateChecksumWithFolderNode(id, title); @@ -272,7 +272,7 @@ bool BookmarkCodec::DecodeNode(const DictionaryValue& value, node->set_type(BookmarkNode::FOLDER); int64 internal_time; base::StringToInt64(last_modified_date, &internal_time); - node->set_date_group_modified(Time::FromInternalValue(internal_time)); + node->set_date_folder_modified(Time::FromInternalValue(internal_time)); if (parent) parent->Add(parent->child_count(), node); diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index f7185a7..f9d6737 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -82,7 +82,7 @@ void BookmarkNode::Reset(const history::StarredEntry& entry) { NOTREACHED(); } date_added_ = entry.date_added; - date_group_modified_ = entry.date_group_modified; + date_folder_modified_ = entry.date_folder_modified; SetTitle(entry.title); } @@ -382,7 +382,7 @@ const BookmarkNode* BookmarkModel::AddGroup(const BookmarkNode* parent, BookmarkNode* new_node = new BookmarkNode(generate_next_node_id(), GURL()); - new_node->set_date_group_modified(Time::Now()); + new_node->set_date_folder_modified(Time::Now()); new_node->SetTitle(title); new_node->set_type(BookmarkNode::FOLDER); @@ -476,7 +476,7 @@ void BookmarkModel::SetURLStarred(const GURL& url, void BookmarkModel::SetDateGroupModified(const BookmarkNode* parent, const Time time) { DCHECK(parent); - AsMutable(parent)->set_date_group_modified(time); + AsMutable(parent)->set_date_folder_modified(time); if (store_.get()) store_->ScheduleSave(); diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index e4cb785..9c5ebad 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -74,21 +74,23 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> { BookmarkNode::Type type() const { return type_; } void set_type(BookmarkNode::Type type) { type_ = type; } - // Returns the time the bookmark/group was added. + // Returns the time the bookmark/folder was added. const base::Time& date_added() const { return date_added_; } - // Sets the time the bookmark/group was added. + // Sets the time the bookmark/folder was added. void set_date_added(const base::Time& date) { date_added_ = date; } - // Returns the last time the group was modified. This is only maintained + // Returns the last time the folder was modified. This is only maintained // for folders (including the bookmark and other folder). - const base::Time& date_group_modified() const { return date_group_modified_; } - // Sets the last time the group was modified. - void set_date_group_modified(const base::Time& date) { - date_group_modified_ = date; + const base::Time& date_folder_modified() const { + return date_folder_modified_; + } + // Sets the last time the folder was modified. + void set_date_folder_modified(const base::Time& date) { + date_folder_modified_ = date; } - // Convenience for testing if this nodes represents a group. A group is - // a node whose type is not URL. + // Convenience for testing if this nodes represents a folder. A folder is a + // node whose type is not URL. bool is_folder() const { return type_ != URL; } // Is this a URL? @@ -151,8 +153,8 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> { // Date we were created. base::Time date_added_; - // Time last modified. Only used for groups. - base::Time date_group_modified_; + // Time last modified. Only used for folders. + base::Time date_folder_modified_; DISALLOW_COPY_AND_ASSIGN(BookmarkNode); }; @@ -160,7 +162,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> { // BookmarkModel -------------------------------------------------------------- // BookmarkModel provides a directed acyclic graph of the starred entries -// and groups. Two graphs are provided for the two entry points: those on +// and folders. Two graphs are provided for the two entry points: those on // the bookmark bar, and those in the other folder. // // An observer may be attached to observer relevant events. @@ -208,8 +210,7 @@ class BookmarkModel : public NotificationObserver, public BookmarkService { void BeginImportMode(); void EndImportMode(); - - // Unstars or deletes the specified entry. Removing a group entry recursively + // Unstars or deletes the specified entry. Removing a folder entry recursively // unstars all nodes. Observers are notified immediately. void Remove(const BookmarkNode* parent, int index); diff --git a/chrome/browser/bookmarks/bookmark_model_test_utils.cc b/chrome/browser/bookmarks/bookmark_model_test_utils.cc index a8503d7..7286a9e 100644 --- a/chrome/browser/bookmarks/bookmark_model_test_utils.cc +++ b/chrome/browser/bookmarks/bookmark_model_test_utils.cc @@ -21,8 +21,8 @@ void BookmarkModelTestUtils::AssertNodesEqual(const BookmarkNode* expected, if (expected->type() == BookmarkNode::URL) { EXPECT_EQ(expected->GetURL(), actual->GetURL()); } else { - EXPECT_TRUE(expected->date_group_modified() == - actual->date_group_modified()); + EXPECT_TRUE(expected->date_folder_modified() == + actual->date_folder_modified()); ASSERT_EQ(expected->child_count(), actual->child_count()); for (int i = 0; i < expected->child_count(); ++i) AssertNodesEqual(expected->GetChild(i), actual->GetChild(i), check_ids); diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index 652aca8..3ba8536 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -171,7 +171,7 @@ bool ShouldOpenAll(gfx::NativeWindow parent, // Comparison function that compares based on date modified of the two nodes. bool MoreRecentlyModified(const BookmarkNode* n1, const BookmarkNode* n2) { - return n1->date_group_modified() > n2->date_group_modified(); + return n1->date_folder_modified() > n2->date_folder_modified(); } // Returns true if |text| contains each string in |words|. This is used when @@ -446,7 +446,7 @@ std::vector<const BookmarkNode*> GetMostRecentlyModifiedGroups( ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); while (iterator.has_next()) { const BookmarkNode* parent = iterator.Next(); - if (parent->is_folder() && parent->date_group_modified() > base::Time()) { + if (parent->is_folder() && parent->date_folder_modified() > base::Time()) { if (max_count == 0) { nodes.push_back(parent); } else { diff --git a/chrome/browser/extensions/extension_bookmark_helpers.cc b/chrome/browser/extensions/extension_bookmark_helpers.cc index 047cb99..eebdf4c 100644 --- a/chrome/browser/extensions/extension_bookmark_helpers.cc +++ b/chrome/browser/extensions/extension_bookmark_helpers.cc @@ -31,7 +31,7 @@ DictionaryValue* GetNodeDictionary(const BookmarkNode* node, } else { // Javascript Date wants milliseconds since the epoch, ToDoubleT is // seconds. - base::Time t = node->date_group_modified(); + base::Time t = node->date_folder_modified(); if (!t.is_null()) dict->SetDouble(keys::kDateGroupModifiedKey, floor(t.ToDoubleT() * 1000)); } diff --git a/chrome/browser/history/history_types.cc b/chrome/browser/history/history_types.cc index aa83bc8..84edddd 100644 --- a/chrome/browser/history/history_types.cc +++ b/chrome/browser/history/history_types.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -121,7 +121,7 @@ void StarredEntry::Swap(StarredEntry* other) { std::swap(type, other->type); url.Swap(&other->url); std::swap(url_id, other->url_id); - std::swap(date_group_modified, other->date_group_modified); + std::swap(date_folder_modified, other->date_folder_modified); } // URLResult ------------------------------------------------------------------- diff --git a/chrome/browser/history/history_types.h b/chrome/browser/history/history_types.h index a6822cb..f38472b 100644 --- a/chrome/browser/history/history_types.h +++ b/chrome/browser/history/history_types.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -325,7 +325,7 @@ struct StarredEntry { // Time the entry was last modified. This is only used for groups and // indicates the last time a URL was added as a child to the group. - base::Time date_group_modified; + base::Time date_folder_modified; }; // URLResult ------------------------------------------------------------------- diff --git a/chrome/browser/history/starred_url_database.cc b/chrome/browser/history/starred_url_database.cc index 439e92e32..8dd55a2 100644 --- a/chrome/browser/history/starred_url_database.cc +++ b/chrome/browser/history/starred_url_database.cc @@ -35,7 +35,7 @@ // parent_id Group ID of the parent this entry is contained in, if 0 // entry is not in a group. // date_modified Time the group was last modified. See comments in -// StarredEntry::date_group_modified +// StarredEntry::date_folder_modified // NOTE: group_id and parent_id come from the UI, id is assigned by the // db. @@ -77,7 +77,7 @@ void FillInStarredEntry(const sql::Statement& s, StarredEntry* entry) { entry->parent_group_id = s.ColumnInt64(5); entry->url_id = s.ColumnInt64(7); entry->group_id = s.ColumnInt64(8); - entry->date_group_modified = base::Time::FromInternalValue(s.ColumnInt64(9)); + entry->date_folder_modified = base::Time::FromInternalValue(s.ColumnInt64(9)); } } // namespace @@ -409,7 +409,7 @@ bool StarredURLDatabase::EnsureVisualOrder( entry.visual_order = i; LOG(WARNING) << "Bookmark visual order is wrong"; if (!UpdateStarredEntryRow(entry.id, entry.title, entry.parent_group_id, - i, entry.date_group_modified)) { + i, entry.date_folder_modified)) { NOTREACHED() << "Unable to update visual order"; return false; } @@ -525,7 +525,7 @@ bool StarredURLDatabase::Move(StarredNode* source, StarredNode* new_parent) { entry.parent_group_id = new_parent->value.group_id; if (!UpdateStarredEntryRow(entry.id, entry.title, entry.parent_group_id, entry.visual_order, - entry.date_group_modified)) { + entry.date_folder_modified)) { NOTREACHED() << "Unable to move folder"; return false; } |