Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: chrome/browser/bookmarks/bookmark_utils.cc

Issue 10689095: browser: Put simple_message_box.h and chrome_web_contents_view_delegate.h into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 bool ShouldOpenAll(gfx::NativeWindow parent, 170 bool ShouldOpenAll(gfx::NativeWindow parent,
171 const std::vector<const BookmarkNode*>& nodes) { 171 const std::vector<const BookmarkNode*>& nodes) {
172 int child_count = 0; 172 int child_count = 0;
173 for (size_t i = 0; i < nodes.size(); ++i) 173 for (size_t i = 0; i < nodes.size(); ++i)
174 child_count += ChildURLCount(nodes[i]); 174 child_count += ChildURLCount(nodes[i]);
175 if (child_count < bookmark_utils::num_urls_before_prompting) 175 if (child_count < bookmark_utils::num_urls_before_prompting)
176 return true; 176 return true;
177 177
178 return browser::ShowMessageBox(parent, 178 return chrome::ShowMessageBox(parent,
179 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), 179 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
180 l10n_util::GetStringFUTF16(IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL, 180 l10n_util::GetStringFUTF16(IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL,
181 base::IntToString16(child_count)), 181 base::IntToString16(child_count)),
182 browser::MESSAGE_BOX_TYPE_QUESTION) == browser::MESSAGE_BOX_RESULT_YES; 182 chrome::MESSAGE_BOX_TYPE_QUESTION) == chrome::MESSAGE_BOX_RESULT_YES;
183 } 183 }
184 184
185 // Comparison function that compares based on date modified of the two nodes. 185 // Comparison function that compares based on date modified of the two nodes.
186 bool MoreRecentlyModified(const BookmarkNode* n1, const BookmarkNode* n2) { 186 bool MoreRecentlyModified(const BookmarkNode* n1, const BookmarkNode* n2) {
187 return n1->date_folder_modified() > n2->date_folder_modified(); 187 return n1->date_folder_modified() > n2->date_folder_modified();
188 } 188 }
189 189
190 // Returns true if |text| contains each string in |words|. This is used when 190 // Returns true if |text| contains each string in |words|. This is used when
191 // searching for bookmarks. 191 // searching for bookmarks.
192 bool DoesBookmarkTextContainWords(const string16& text, 192 bool DoesBookmarkTextContainWords(const string16& text,
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 for (int i = 0; i < node->child_count(); ++i) { 703 for (int i = 0; i < node->child_count(); ++i) {
704 if (NodeHasURLs(node->GetChild(i))) 704 if (NodeHasURLs(node->GetChild(i)))
705 return true; 705 return true;
706 } 706 }
707 return false; 707 return false;
708 } 708 }
709 709
710 bool ConfirmDeleteBookmarkNode(const BookmarkNode* node, 710 bool ConfirmDeleteBookmarkNode(const BookmarkNode* node,
711 gfx::NativeWindow window) { 711 gfx::NativeWindow window) {
712 DCHECK(node && node->is_folder() && !node->empty()); 712 DCHECK(node && node->is_folder() && !node->empty());
713 return browser::ShowMessageBox(window, 713 return chrome::ShowMessageBox(window,
714 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), 714 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
715 l10n_util::GetStringFUTF16Int(IDS_BOOKMARK_EDITOR_CONFIRM_DELETE, 715 l10n_util::GetStringFUTF16Int(IDS_BOOKMARK_EDITOR_CONFIRM_DELETE,
716 ChildURLCountTotal(node)), 716 ChildURLCountTotal(node)),
717 browser::MESSAGE_BOX_TYPE_QUESTION) == browser::MESSAGE_BOX_RESULT_YES; 717 chrome::MESSAGE_BOX_TYPE_QUESTION) == chrome::MESSAGE_BOX_RESULT_YES;
718 } 718 }
719 719
720 void DeleteBookmarkFolders(BookmarkModel* model, 720 void DeleteBookmarkFolders(BookmarkModel* model,
721 const std::vector<int64>& ids) { 721 const std::vector<int64>& ids) {
722 // Remove the folders that were removed. This has to be done after all the 722 // Remove the folders that were removed. This has to be done after all the
723 // other changes have been committed. 723 // other changes have been committed.
724 for (std::vector<int64>::const_iterator iter = ids.begin(); 724 for (std::vector<int64>::const_iterator iter = ids.begin();
725 iter != ids.end(); 725 iter != ids.end();
726 ++iter) { 726 ++iter) {
727 const BookmarkNode* node = model->GetNodeByID(*iter); 727 const BookmarkNode* node = model->GetNodeByID(*iter);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 void DisableBookmarkBarViewAnimationsForTesting(bool disabled) { 770 void DisableBookmarkBarViewAnimationsForTesting(bool disabled) {
771 g_bookmark_bar_view_animations_disabled = disabled; 771 g_bookmark_bar_view_animations_disabled = disabled;
772 } 772 }
773 773
774 bool IsBookmarkBarViewAnimationsDisabled() { 774 bool IsBookmarkBarViewAnimationsDisabled() {
775 return g_bookmark_bar_view_animations_disabled; 775 return g_bookmark_bar_view_animations_disabled;
776 } 776 }
777 #endif 777 #endif
778 778
779 } // namespace bookmark_utils 779 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698