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

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

Issue 42103: Fixes bug were sorting bookmarks wouldn't trigger a save.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 months 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 "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/bookmarks/bookmark_utils.h" 9 #include "chrome/browser/bookmarks/bookmark_utils.h"
10 #include "chrome/browser/bookmarks/bookmark_storage.h" 10 #include "chrome/browser/bookmarks/bookmark_storage.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 UErrorCode error = U_ZERO_ERROR; 335 UErrorCode error = U_ZERO_ERROR;
336 scoped_ptr<Collator> collator( 336 scoped_ptr<Collator> collator(
337 Collator::createInstance( 337 Collator::createInstance(
338 Locale(WideToUTF8(g_browser_process->GetApplicationLocale()).c_str()), 338 Locale(WideToUTF8(g_browser_process->GetApplicationLocale()).c_str()),
339 error)); 339 error));
340 if (U_FAILURE(error)) 340 if (U_FAILURE(error))
341 collator.reset(NULL); 341 collator.reset(NULL);
342 std::sort(parent->children().begin(), parent->children().end(), 342 std::sort(parent->children().begin(), parent->children().end(),
343 SortComparator(collator.get())); 343 SortComparator(collator.get()));
344 344
345 if (store_.get())
346 store_->ScheduleSave();
347
345 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, 348 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_,
346 BookmarkNodeChildrenReordered(this, parent)); 349 BookmarkNodeChildrenReordered(this, parent));
347 } 350 }
348 351
349 void BookmarkModel::SetURLStarred(const GURL& url, 352 void BookmarkModel::SetURLStarred(const GURL& url,
350 const std::wstring& title, 353 const std::wstring& title,
351 bool is_starred) { 354 bool is_starred) {
352 std::vector<BookmarkNode*> bookmarks; 355 std::vector<BookmarkNode*> bookmarks;
353 GetNodesByURL(url, &bookmarks); 356 GetNodesByURL(url, &bookmarks);
354 bool bookmarks_exist = !bookmarks.empty(); 357 bool bookmarks_exist = !bookmarks.empty();
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 } 723 }
721 724
722 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) { 725 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) {
723 // NOTE: this is called with url_lock_ already held. As such, this doesn't 726 // NOTE: this is called with url_lock_ already held. As such, this doesn't
724 // explicitly grab the lock. 727 // explicitly grab the lock.
725 if (node->is_url()) 728 if (node->is_url())
726 nodes_ordered_by_url_set_.insert(node); 729 nodes_ordered_by_url_set_.insert(node);
727 for (int i = 0; i < node->GetChildCount(); ++i) 730 for (int i = 0; i < node->GetChildCount(); ++i)
728 PopulateNodesByURL(node->GetChild(i)); 731 PopulateNodesByURL(node->GetChild(i));
729 } 732 }
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