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

Side by Side Diff: chrome/browser/ui/webui/ntp/bookmarks_handler.cc

Issue 8759017: BookmarkModel cleanup. synced_node is now mobile_node and I'm nuking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk fix sync_integration_tests and extension test Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/webui/ntp/bookmarks_handler.h" 5 #include "chrome/browser/ui/webui/ntp/bookmarks_handler.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 NewTabUI::SetURLTitleAndDirection(dict, node->GetTitle(), node->url()); 316 NewTabUI::SetURLTitleAndDirection(dict, node->GetTitle(), node->url());
317 317
318 if (!node->is_folder()) 318 if (!node->is_folder())
319 dict->SetString(keys::kUrlKey, node->url().spec()); 319 dict->SetString(keys::kUrlKey, node->url().spec());
320 320
321 return dict; 321 return dict;
322 } 322 }
323 323
324 void BookmarksHandler::AddNode(const BookmarkNode* node, 324 void BookmarksHandler::AddNode(const BookmarkNode* node,
325 base::ListValue* list) { 325 base::ListValue* list) {
326 if (node->IsVisible()) { 326 list->Append(GetNodeDictionary(node));
327 base::DictionaryValue* dict = GetNodeDictionary(node);
328 list->Append(dict);
329 }
330 } 327 }
331 328
332 // static 329 // static
333 void BookmarksHandler::RegisterUserPrefs(PrefService* prefs) { 330 void BookmarksHandler::RegisterUserPrefs(PrefService* prefs) {
334 // Default folder is the root node. 331 // Default folder is the root node.
335 // TODO(csilv): Should we sync this preference? 332 // TODO(csilv): Should we sync this preference?
336 prefs->RegisterInt64Pref(prefs::kNTPShownBookmarksFolder, 0, 333 prefs->RegisterInt64Pref(prefs::kNTPShownBookmarksFolder, 0,
337 PrefService::UNSYNCABLE_PREF); 334 PrefService::UNSYNCABLE_PREF);
338 } 335 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698