| 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/bookmarks/bookmark_model.h" | 5 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 void BookmarkNode::InvalidateFavicon() { | 61 void BookmarkNode::InvalidateFavicon() { |
| 62 loaded_favicon_ = false; | 62 loaded_favicon_ = false; |
| 63 favicon_ = SkBitmap(); | 63 favicon_ = SkBitmap(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool BookmarkNode::IsVisible() const { | 66 bool BookmarkNode::IsVisible() const { |
| 67 // The synced bookmark folder is invisible if the flag isn't set and there are | 67 // The synced bookmark folder is invisible if the flag isn't set and there are |
| 68 // no bookmarks under it. | 68 // no bookmarks under it. |
| 69 if (type_ != BookmarkNode::SYNCED || | 69 if (type_ != BookmarkNode::SYNCED || |
| 70 CommandLine::ForCurrentProcess()->HasSwitch( | 70 CommandLine::ForCurrentProcess()->HasSwitch( |
| 71 switches::kEnableSyncedBookmarksFolder) || | 71 switches::kEnableSyncedBookmarksFolder) || !empty()) { |
| 72 child_count() > 0) { | |
| 73 return true; | 72 return true; |
| 74 } | 73 } |
| 75 return false; | 74 return false; |
| 76 } | 75 } |
| 77 | 76 |
| 78 void BookmarkNode::Reset(const history::StarredEntry& entry) { | 77 void BookmarkNode::Reset(const history::StarredEntry& entry) { |
| 79 DCHECK(entry.type != history::StarredEntry::URL || entry.url == url_); | 78 DCHECK(entry.type != history::StarredEntry::URL || entry.url == url_); |
| 80 | 79 |
| 81 favicon_ = SkBitmap(); | 80 favicon_ = SkBitmap(); |
| 82 switch (entry.type) { | 81 switch (entry.type) { |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 } | 853 } |
| 855 | 854 |
| 856 BookmarkLoadDetails* BookmarkModel::CreateLoadDetails() { | 855 BookmarkLoadDetails* BookmarkModel::CreateLoadDetails() { |
| 857 BookmarkNode* bb_node = CreateBookmarkNode(); | 856 BookmarkNode* bb_node = CreateBookmarkNode(); |
| 858 BookmarkNode* other_folder_node = CreateOtherBookmarksNode(); | 857 BookmarkNode* other_folder_node = CreateOtherBookmarksNode(); |
| 859 BookmarkNode* synced_folder_node = CreateSyncedBookmarksNode(); | 858 BookmarkNode* synced_folder_node = CreateSyncedBookmarksNode(); |
| 860 return new BookmarkLoadDetails( | 859 return new BookmarkLoadDetails( |
| 861 bb_node, other_folder_node, synced_folder_node, | 860 bb_node, other_folder_node, synced_folder_node, |
| 862 new BookmarkIndex(profile()), next_node_id_); | 861 new BookmarkIndex(profile()), next_node_id_); |
| 863 } | 862 } |
| OLD | NEW |