OLD | NEW |
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" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/bookmarks/bookmark_model.h" | 12 #include "chrome/browser/bookmarks/bookmark_model.h" |
13 #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" | 13 #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" |
14 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/sync/profile_sync_service.h" | 16 #include "chrome/browser/sync/profile_sync_service.h" |
17 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 17 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
18 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
19 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
20 #include "content/common/notification_service.h" | |
21 | 20 |
22 // TODO(csilv): | 21 // TODO(csilv): |
23 // Much of this implementation is based on the classes defined in | 22 // Much of this implementation is based on the classes defined in |
24 // extension_bookmarks_module.cc. Longer term we should consider migrating | 23 // extension_bookmarks_module.cc. Longer term we should consider migrating |
25 // NTP into an embedded extension which would allow us to leverage the same | 24 // NTP into an embedded extension which would allow us to leverage the same |
26 // bookmark APIs as the bookmark manager. | 25 // bookmark APIs as the bookmark manager. |
27 | 26 |
28 namespace keys = extension_bookmarks_module_constants; | 27 namespace keys = extension_bookmarks_module_constants; |
29 | 28 |
30 BookmarksHandler::BookmarksHandler() : model_(NULL), | 29 BookmarksHandler::BookmarksHandler() : model_(NULL), |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 329 } |
331 } | 330 } |
332 | 331 |
333 // static | 332 // static |
334 void BookmarksHandler::RegisterUserPrefs(PrefService* prefs) { | 333 void BookmarksHandler::RegisterUserPrefs(PrefService* prefs) { |
335 // Default folder is the root node. | 334 // Default folder is the root node. |
336 // TODO(csilv): Should we sync this preference? | 335 // TODO(csilv): Should we sync this preference? |
337 prefs->RegisterInt64Pref(prefs::kNTPShownBookmarksFolder, 0, | 336 prefs->RegisterInt64Pref(prefs::kNTPShownBookmarksFolder, 0, |
338 PrefService::UNSYNCABLE_PREF); | 337 PrefService::UNSYNCABLE_PREF); |
339 } | 338 } |
OLD | NEW |