| 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 return ShowQuestionMessageBox( | 232 return ShowQuestionMessageBox( |
| 233 window, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 233 window, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
| 234 l10n_util::GetPluralStringFUTF16( | 234 l10n_util::GetPluralStringFUTF16( |
| 235 IDS_BOOKMARK_EDITOR_CONFIRM_DELETE, | 235 IDS_BOOKMARK_EDITOR_CONFIRM_DELETE, |
| 236 ChildURLCountTotal(node))) == | 236 ChildURLCountTotal(node))) == |
| 237 MESSAGE_BOX_RESULT_YES; | 237 MESSAGE_BOX_RESULT_YES; |
| 238 } | 238 } |
| 239 | 239 |
| 240 void ShowBookmarkAllTabsDialog(Browser* browser) { | 240 void ShowBookmarkAllTabsDialog(Browser* browser) { |
| 241 Profile* profile = browser->profile(); | 241 Profile* profile = browser->profile(); |
| 242 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); | 242 BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile); |
| 243 DCHECK(model && model->loaded()); | 243 DCHECK(model && model->loaded()); |
| 244 | 244 |
| 245 const BookmarkNode* parent = model->GetParentForNewNodes(); | 245 const BookmarkNode* parent = model->GetParentForNewNodes(); |
| 246 BookmarkEditor::EditDetails details = | 246 BookmarkEditor::EditDetails details = |
| 247 BookmarkEditor::EditDetails::AddFolder(parent, parent->child_count()); | 247 BookmarkEditor::EditDetails::AddFolder(parent, parent->child_count()); |
| 248 GetURLsForOpenTabs(browser, &(details.urls)); | 248 GetURLsForOpenTabs(browser, &(details.urls)); |
| 249 DCHECK(!details.urls.empty()); | 249 DCHECK(!details.urls.empty()); |
| 250 | 250 |
| 251 BookmarkEditor::Show(browser->window()->GetNativeWindow(), profile, details, | 251 BookmarkEditor::Show(browser->window()->GetNativeWindow(), profile, details, |
| 252 BookmarkEditor::SHOW_TREE); | 252 BookmarkEditor::SHOW_TREE); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 264 while (iterator.has_next()) { | 264 while (iterator.has_next()) { |
| 265 const GURL* url = iterator.NextURL(); | 265 const GURL* url = iterator.NextURL(); |
| 266 if (IsURLAllowedInIncognito(*url, browser_context)) | 266 if (IsURLAllowedInIncognito(*url, browser_context)) |
| 267 return true; | 267 return true; |
| 268 } | 268 } |
| 269 return false; | 269 return false; |
| 270 } | 270 } |
| 271 #endif // !defined(OS_ANDROID) | 271 #endif // !defined(OS_ANDROID) |
| 272 | 272 |
| 273 } // namespace chrome | 273 } // namespace chrome |
| OLD | NEW |