OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/drag_drop_types.h" | 7 #include "app/drag_drop_types.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/tree_node_iterator.h" | 9 #include "app/tree_node_iterator.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/string_util.h" | 12 #include "base/string_number_conversions.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 15 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
16 #include "chrome/browser/bookmarks/bookmark_model.h" | 16 #include "chrome/browser/bookmarks/bookmark_model.h" |
17 #if defined(OS_MACOSX) | 17 #if defined(OS_MACOSX) |
18 #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" | 18 #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" |
19 #endif | 19 #endif |
20 #include "chrome/browser/browser.h" | 20 #include "chrome/browser/browser.h" |
21 #include "chrome/browser/browser_list.h" | 21 #include "chrome/browser/browser_list.h" |
22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 bool ShouldOpenAll(gfx::NativeWindow parent, | 158 bool ShouldOpenAll(gfx::NativeWindow parent, |
159 const std::vector<const BookmarkNode*>& nodes) { | 159 const std::vector<const BookmarkNode*>& nodes) { |
160 int descendant_count = 0; | 160 int descendant_count = 0; |
161 for (size_t i = 0; i < nodes.size(); ++i) | 161 for (size_t i = 0; i < nodes.size(); ++i) |
162 descendant_count += DescendantURLCount(nodes[i]); | 162 descendant_count += DescendantURLCount(nodes[i]); |
163 if (descendant_count < bookmark_utils::num_urls_before_prompting) | 163 if (descendant_count < bookmark_utils::num_urls_before_prompting) |
164 return true; | 164 return true; |
165 | 165 |
166 string16 message = l10n_util::GetStringFUTF16( | 166 string16 message = l10n_util::GetStringFUTF16( |
167 IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL, | 167 IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL, |
168 IntToString16(descendant_count)); | 168 base::IntToString16(descendant_count)); |
169 string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 169 string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
170 return platform_util::SimpleYesNoBox(parent, title, message); | 170 return platform_util::SimpleYesNoBox(parent, title, message); |
171 } | 171 } |
172 | 172 |
173 // Comparison function that compares based on date modified of the two nodes. | 173 // Comparison function that compares based on date modified of the two nodes. |
174 bool MoreRecentlyModified(const BookmarkNode* n1, const BookmarkNode* n2) { | 174 bool MoreRecentlyModified(const BookmarkNode* n1, const BookmarkNode* n2) { |
175 return n1->date_group_modified() > n2->date_group_modified(); | 175 return n1->date_group_modified() > n2->date_group_modified(); |
176 } | 176 } |
177 | 177 |
178 // Returns true if |text| contains each string in |words|. This is used when | 178 // Returns true if |text| contains each string in |words|. This is used when |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 } | 650 } |
651 } else { | 651 } else { |
652 *index = real_parent->GetChildCount(); | 652 *index = real_parent->GetChildCount(); |
653 } | 653 } |
654 } | 654 } |
655 | 655 |
656 return real_parent; | 656 return real_parent; |
657 } | 657 } |
658 | 658 |
659 } // namespace bookmark_utils | 659 } // namespace bookmark_utils |
OLD | NEW |