| OLD | NEW |
| 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_folder_tree_model.h" | 5 #include "chrome/browser/bookmarks/bookmark_folder_tree_model.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| 11 #include "grit/theme_resources.h" | 11 #include "grit/theme_resources.h" |
| 12 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
| 13 | 13 |
| 14 BookmarkFolderTreeModel::BookmarkFolderTreeModel(BookmarkModel* model) | 14 BookmarkFolderTreeModel::BookmarkFolderTreeModel(BookmarkModel* model) |
| 15 : TreeNodeModel<FolderNode>(new FolderNode(NULL)), | 15 : TreeNodeModel<FolderNode>(new FolderNode(NULL)), |
| 16 model_(model), | 16 model_(model), |
| 17 recently_bookmarked_node_(new FolderNode(NULL)), | 17 recently_bookmarked_node_(new FolderNode(NULL)), |
| 18 search_node_(new FolderNode(NULL)){ | 18 search_node_(new FolderNode(NULL)) { |
| 19 recently_bookmarked_node_->SetTitle( | 19 recently_bookmarked_node_->SetTitle( |
| 20 l10n_util::GetString(IDS_BOOKMARK_TREE_RECENTLY_BOOKMARKED_NODE_TITLE)); | 20 l10n_util::GetString(IDS_BOOKMARK_TREE_RECENTLY_BOOKMARKED_NODE_TITLE)); |
| 21 search_node_->SetTitle( | 21 search_node_->SetTitle( |
| 22 l10n_util::GetString(IDS_BOOKMARK_TREE_SEARCH_NODE_TITLE)); | 22 l10n_util::GetString(IDS_BOOKMARK_TREE_SEARCH_NODE_TITLE)); |
| 23 if (model_->IsLoaded()) | 23 if (model_->IsLoaded()) |
| 24 AddRootChildren(); | 24 AddRootChildren(); |
| 25 model_->AddObserver(this); | 25 model_->AddObserver(this); |
| 26 } | 26 } |
| 27 | 27 |
| 28 BookmarkFolderTreeModel::~BookmarkFolderTreeModel() { | 28 BookmarkFolderTreeModel::~BookmarkFolderTreeModel() { |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 for (int i = 0, folder_count = 0; i < parent->GetChildCount(); ++i) { | 225 for (int i = 0, folder_count = 0; i < parent->GetChildCount(); ++i) { |
| 226 const BookmarkNode* child = parent->GetChild(i); | 226 const BookmarkNode* child = parent->GetChild(i); |
| 227 if (child == node) | 227 if (child == node) |
| 228 return folder_count; | 228 return folder_count; |
| 229 if (child->is_folder()) | 229 if (child->is_folder()) |
| 230 folder_count++; | 230 folder_count++; |
| 231 } | 231 } |
| 232 NOTREACHED(); | 232 NOTREACHED(); |
| 233 return 0; | 233 return 0; |
| 234 } | 234 } |
| OLD | NEW |