diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-21 15:20:33 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-21 15:20:33 +0000 |
commit | f25387b62a3cccde48622d0b7fca57cd6fb16ab7 (patch) | |
tree | 06ac2c1972d6608fb65979c3a279a6d214fecc6c /chrome/browser/views/bookmark_editor_view.cc | |
parent | bcc682fc4f5050ac911635ab649fbd30002fc2b4 (diff) | |
download | chromium_src-f25387b62a3cccde48622d0b7fca57cd6fb16ab7.zip chromium_src-f25387b62a3cccde48622d0b7fca57cd6fb16ab7.tar.gz chromium_src-f25387b62a3cccde48622d0b7fca57cd6fb16ab7.tar.bz2 |
Moves bookmarks out of history into its own file (JSON).
Interesting points:
. Migration was a bit atypical. Here is the approach I took:
. If the URL db contains bookmarks it writes the bookmarks to a
temporary file.
. When the bookmark bar model is loaded it assumes bookmarks are
stored in a file. If the bookmarks file doesn't exist it then
attempts to load from history, after waiting for history to finish
processing tasks.
. I've broken having the omnibox query for starred only. This patch
was already too ginormous for me to contemplate this too. I'll return
to it after I land this.
. Similarly the history page isn't searching for starred titles
now. As we discussed with Glen, that is probably fine for now.
. I've converted NOTIFY_STARRED_FAVICON_CHANGED to
NOTIFY_FAVICON_CHANGED and it is notified ANY time a favicon
changes. I'm mildly concerned about the extra notifications, but
without having history know about starred it's the best I can do for
now.
. Autocomplete (specifically URLDatabase::AutocompleteForPrefix)
previously sorted by starred. It can no longer do this. I don't
think I can get this functionality back:( Luckily it only mattered
if you had a starred and non-starred URL with the same type count
that matched a query. Probably pretty rare.
What's left:
. Fix up HistoryContentsProvider to query for starred entries titles.
. Clean up the delete all case. I basically just made it compile; it
can be greatly simplified.
. Rename BookmarkBarModel to BookmarksModel.
BUG=1256202
TEST=this is a huge change to bookmarks. Thanfully it's pretty well
covered by tests, none-the-less make sure you exercise bookmarks
pretty heavily to make sure nothing is busted.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1153 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bookmark_editor_view.cc')
-rw-r--r-- | chrome/browser/views/bookmark_editor_view.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/chrome/browser/views/bookmark_editor_view.cc b/chrome/browser/views/bookmark_editor_view.cc index 8ae30ed..a4e9e8d 100644 --- a/chrome/browser/views/bookmark_editor_view.cc +++ b/chrome/browser/views/bookmark_editor_view.cc @@ -420,9 +420,9 @@ void BookmarkEditorView::ExpandAndSelect() { tree_view_.ExpandAll(); BookmarkBarNode* to_select = bb_model_->GetNodeByURL(url_); - history::UIStarID group_id_to_select = - to_select ? to_select->GetParent()->GetGroupID() : - bb_model_->GetParentForNewNodes()->GetGroupID(); + int group_id_to_select = + to_select ? to_select->GetParent()->id() : + bb_model_->GetParentForNewNodes()->id(); DCHECK(group_id_to_select); // GetMostRecentParent should never return NULL. BookmarkNode* b_node = @@ -448,9 +448,9 @@ void BookmarkEditorView::CreateNodes(BookmarkBarNode* bb_node, BookmarkEditorView::BookmarkNode* b_node) { for (int i = 0; i < bb_node->GetChildCount(); ++i) { BookmarkBarNode* child_bb_node = bb_node->GetChild(i); - if (child_bb_node->GetType() != history::StarredEntry::URL) { + if (child_bb_node->is_folder()) { BookmarkNode* new_b_node = new BookmarkNode(child_bb_node->GetTitle(), - child_bb_node->GetGroupID()); + child_bb_node->id()); b_node->Add(b_node->GetChildCount(), new_b_node); CreateNodes(child_bb_node, new_b_node); } @@ -459,7 +459,7 @@ void BookmarkEditorView::CreateNodes(BookmarkBarNode* bb_node, BookmarkEditorView::BookmarkNode* BookmarkEditorView::FindNodeWithID( BookmarkEditorView::BookmarkNode* node, - history::UIStarID id) { + int id) { if (node->value == id) return node; for (int i = 0; i < node->GetChildCount(); ++i) { @@ -556,8 +556,7 @@ void BookmarkEditorView::ApplyNameChangesAndCreateNewGroups( // is the same). for (int j = 0; j < bb_node->GetChildCount(); ++j) { BookmarkBarNode* node = bb_node->GetChild(j); - if (node->GetType() != history::StarredEntry::URL && - node->GetGroupID() == child_b_node->value) { + if (node->is_folder() && node->id() == child_b_node->value) { child_bb_node = node; break; } |