OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_utils.h" | 5 #include "chrome/browser/bookmarks/bookmark_utils.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/i18n/case_conversion.h" | 11 #include "base/i18n/case_conversion.h" |
12 #include "base/i18n/string_search.h" | 12 #include "base/i18n/string_search.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/prefs/public/pref_service_base.h" | |
15 #include "base/string16.h" | 14 #include "base/string16.h" |
16 #include "base/time.h" | 15 #include "base/time.h" |
17 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
18 #include "chrome/browser/bookmarks/bookmark_model.h" | 17 #include "chrome/browser/bookmarks/bookmark_model.h" |
19 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 18 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
20 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 19 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
21 #include "chrome/browser/history/query_parser.h" | 20 #include "chrome/browser/history/query_parser.h" |
| 21 #include "chrome/browser/prefs/pref_service.h" |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
24 #include "content/public/browser/user_metrics.h" | 24 #include "content/public/browser/user_metrics.h" |
25 #include "grit/ui_strings.h" | 25 #include "grit/ui_strings.h" |
26 #include "net/base/net_util.h" | 26 #include "net/base/net_util.h" |
27 #include "ui/base/dragdrop/drag_drop_types.h" | 27 #include "ui/base/dragdrop/drag_drop_types.h" |
28 #include "ui/base/events/event.h" | 28 #include "ui/base/events/event.h" |
29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
30 #include "ui/base/models/tree_node_iterator.h" | 30 #include "ui/base/models/tree_node_iterator.h" |
31 | 31 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 429 |
430 if (new_parent != node->parent()) | 430 if (new_parent != node->parent()) |
431 model->Move(node, new_parent, new_parent->child_count()); | 431 model->Move(node, new_parent, new_parent->child_count()); |
432 if (node->is_url()) | 432 if (node->is_url()) |
433 model->SetURL(node, new_url); | 433 model->SetURL(node, new_url); |
434 model->SetTitle(node, new_title); | 434 model->SetTitle(node, new_title); |
435 | 435 |
436 return node; | 436 return node; |
437 } | 437 } |
438 | 438 |
439 void RegisterUserPrefs(PrefServiceBase* prefs) { | 439 void RegisterUserPrefs(PrefServiceSyncable* prefs) { |
440 prefs->RegisterBooleanPref(prefs::kShowBookmarkBar, | 440 prefs->RegisterBooleanPref(prefs::kShowBookmarkBar, |
441 false, | 441 false, |
442 PrefServiceBase::SYNCABLE_PREF); | 442 PrefServiceSyncable::SYNCABLE_PREF); |
443 prefs->RegisterBooleanPref(prefs::kEditBookmarksEnabled, | 443 prefs->RegisterBooleanPref(prefs::kEditBookmarksEnabled, |
444 true, | 444 true, |
445 PrefServiceBase::UNSYNCABLE_PREF); | 445 PrefServiceSyncable::UNSYNCABLE_PREF); |
446 } | 446 } |
447 | 447 |
448 const BookmarkNode* GetParentForNewNodes( | 448 const BookmarkNode* GetParentForNewNodes( |
449 const BookmarkNode* parent, | 449 const BookmarkNode* parent, |
450 const std::vector<const BookmarkNode*>& selection, | 450 const std::vector<const BookmarkNode*>& selection, |
451 int* index) { | 451 int* index) { |
452 const BookmarkNode* real_parent = parent; | 452 const BookmarkNode* real_parent = parent; |
453 | 453 |
454 if (selection.size() == 1 && selection[0]->is_folder()) | 454 if (selection.size() == 1 && selection[0]->is_folder()) |
455 real_parent = selection[0]; | 455 real_parent = selection[0]; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 void DisableBookmarkBarViewAnimationsForTesting(bool disabled) { | 524 void DisableBookmarkBarViewAnimationsForTesting(bool disabled) { |
525 g_bookmark_bar_view_animations_disabled = disabled; | 525 g_bookmark_bar_view_animations_disabled = disabled; |
526 } | 526 } |
527 | 527 |
528 bool IsBookmarkBarViewAnimationsDisabled() { | 528 bool IsBookmarkBarViewAnimationsDisabled() { |
529 return g_bookmark_bar_view_animations_disabled; | 529 return g_bookmark_bar_view_animations_disabled; |
530 } | 530 } |
531 #endif | 531 #endif |
532 | 532 |
533 } // namespace bookmark_utils | 533 } // namespace bookmark_utils |
OLD | NEW |