Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: chrome/browser/bookmarks/bookmark_model.cc

Issue 10709: Fixes bug in adding bookmark groups. Adding wasn't setting the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/bookmarks/bookmark_model.h" 5 #include "chrome/browser/bookmarks/bookmark_model.h"
6 6
7 #include "base/gfx/png_decoder.h" 7 #include "base/gfx/png_decoder.h"
8 #include "chrome/browser/bookmarks/bookmark_storage.h" 8 #include "chrome/browser/bookmarks/bookmark_storage.h"
9 #include "chrome/browser/history/query_parser.h" 9 #include "chrome/browser/history/query_parser.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 BookmarkNode* parent, 333 BookmarkNode* parent,
334 int index, 334 int index,
335 const std::wstring& title) { 335 const std::wstring& title) {
336 if (!loaded_ || parent == &root_ || !IsValidIndex(parent, index, true)) { 336 if (!loaded_ || parent == &root_ || !IsValidIndex(parent, index, true)) {
337 // Can't add to the root. 337 // Can't add to the root.
338 NOTREACHED(); 338 NOTREACHED();
339 return NULL; 339 return NULL;
340 } 340 }
341 341
342 BookmarkNode* new_node = new BookmarkNode(this, GURL()); 342 BookmarkNode* new_node = new BookmarkNode(this, GURL());
343 new_node->date_group_modified_ = Time::Now();
343 new_node->SetTitle(title); 344 new_node->SetTitle(title);
344 new_node->type_ = history::StarredEntry::USER_GROUP; 345 new_node->type_ = history::StarredEntry::USER_GROUP;
345 346
346 return AddNode(parent, index, new_node, false); 347 return AddNode(parent, index, new_node, false);
347 } 348 }
348 349
349 BookmarkNode* BookmarkModel::AddURL(BookmarkNode* parent, 350 BookmarkNode* BookmarkModel::AddURL(BookmarkNode* parent,
350 int index, 351 int index,
351 const std::wstring& title, 352 const std::wstring& title,
352 const GURL& url) { 353 const GURL& url) {
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 } 773 }
773 774
774 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) { 775 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) {
775 // NOTE: this is called with url_lock_ already held. As such, this doesn't 776 // NOTE: this is called with url_lock_ already held. As such, this doesn't
776 // explicitly grab the lock. 777 // explicitly grab the lock.
777 if (node->is_url()) 778 if (node->is_url())
778 nodes_ordered_by_url_set_.insert(node); 779 nodes_ordered_by_url_set_.insert(node);
779 for (int i = 0; i < node->GetChildCount(); ++i) 780 for (int i = 0; i < node->GetChildCount(); ++i)
780 PopulateNodesByURL(node->GetChild(i)); 781 PopulateNodesByURL(node->GetChild(i));
781 } 782 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698