Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bookmarks/bookmark_utils_desktop.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h" |
| 6 | 6 |
| 7 #include "base/i18n/number_formatting.h" | |
| 7 #include "base/logging.h" | 8 #include "base/logging.h" |
| 8 #include "base/macros.h" | 9 #include "base/macros.h" |
| 9 #include "base/strings/string_number_conversions.h" | |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/search/search.h" | 13 #include "chrome/browser/search/search.h" |
| 14 #include "chrome/browser/ui/app_list/app_list_util.h" | 14 #include "chrome/browser/ui/app_list/app_list_util.h" |
| 15 #include "chrome/browser/ui/bookmarks/bookmark_editor.h" | 15 #include "chrome/browser/ui/bookmarks/bookmark_editor.h" |
| 16 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 16 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_navigator.h" | 18 #include "chrome/browser/ui/browser_navigator.h" |
| 19 #include "chrome/browser/ui/browser_window.h" | 19 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 iterator.NextURL(); | 134 iterator.NextURL(); |
| 135 child_count++; | 135 child_count++; |
| 136 } | 136 } |
| 137 | 137 |
| 138 if (child_count < num_bookmark_urls_before_prompting) | 138 if (child_count < num_bookmark_urls_before_prompting) |
| 139 return true; | 139 return true; |
| 140 | 140 |
| 141 return ShowQuestionMessageBox( | 141 return ShowQuestionMessageBox( |
| 142 parent, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 142 parent, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
| 143 l10n_util::GetStringFUTF16(IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL, | 143 l10n_util::GetStringFUTF16(IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL, |
| 144 base::IntToString16(child_count))) == | 144 base::FormatNumber(child_count))) == |
|
jungshik at Google
2016/05/20 23:58:03
This need to use a plural format (GetPluralStringF
Greg Levin
2016/05/26 14:03:13
Ok, reverted my change to this file in next patch.
| |
| 145 MESSAGE_BOX_RESULT_YES; | 145 MESSAGE_BOX_RESULT_YES; |
| 146 } | 146 } |
| 147 #endif | 147 #endif |
| 148 | 148 |
| 149 // Returns the total number of descendants nodes. | 149 // Returns the total number of descendants nodes. |
| 150 int ChildURLCountTotal(const BookmarkNode* node) { | 150 int ChildURLCountTotal(const BookmarkNode* node) { |
| 151 int result = 0; | 151 int result = 0; |
| 152 for (int i = 0; i < node->child_count(); ++i) { | 152 for (int i = 0; i < node->child_count(); ++i) { |
| 153 const BookmarkNode* child = node->GetChild(i); | 153 const BookmarkNode* child = node->GetChild(i); |
| 154 result++; | 154 result++; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 263 while (iterator.has_next()) { | 263 while (iterator.has_next()) { |
| 264 const GURL* url = iterator.NextURL(); | 264 const GURL* url = iterator.NextURL(); |
| 265 if (IsURLAllowedInIncognito(*url, browser_context)) | 265 if (IsURLAllowedInIncognito(*url, browser_context)) |
| 266 return true; | 266 return true; |
| 267 } | 267 } |
| 268 return false; | 268 return false; |
| 269 } | 269 } |
| 270 #endif // !defined(OS_ANDROID) | 270 #endif // !defined(OS_ANDROID) |
| 271 | 271 |
| 272 } // namespace chrome | 272 } // namespace chrome |
| OLD | NEW |