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

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

Issue 8552002: net: Move UnescapeRule into the net namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // Returns true if |node|s title or url contains the strings in |words|. 214 // Returns true if |node|s title or url contains the strings in |words|.
215 // |languages| argument is user's accept-language setting to decode IDN. 215 // |languages| argument is user's accept-language setting to decode IDN.
216 bool DoesBookmarkContainWords(const BookmarkNode* node, 216 bool DoesBookmarkContainWords(const BookmarkNode* node,
217 const std::vector<string16>& words, 217 const std::vector<string16>& words,
218 const std::string& languages) { 218 const std::string& languages) {
219 return 219 return
220 DoesBookmarkTextContainWords(node->GetTitle(), words) || 220 DoesBookmarkTextContainWords(node->GetTitle(), words) ||
221 DoesBookmarkTextContainWords(UTF8ToUTF16(node->url().spec()), words) || 221 DoesBookmarkTextContainWords(UTF8ToUTF16(node->url().spec()), words) ||
222 DoesBookmarkTextContainWords(net::FormatUrl( 222 DoesBookmarkTextContainWords(net::FormatUrl(
223 node->url(), languages, net::kFormatUrlOmitNothing, 223 node->url(), languages, net::kFormatUrlOmitNothing,
224 UnescapeRule::NORMAL, NULL, NULL, NULL), words); 224 net::UnescapeRule::NORMAL, NULL, NULL, NULL), words);
225 } 225 }
226 226
227 } // namespace 227 } // namespace
228 228
229 namespace bookmark_utils { 229 namespace bookmark_utils {
230 230
231 int num_urls_before_prompting = 15; 231 int num_urls_before_prompting = 15;
232 232
233 int PreferredDropOperation(int source_operations, int operations) { 233 int PreferredDropOperation(int source_operations, int operations) {
234 int common_ops = (source_operations & operations); 234 int common_ops = (source_operations & operations);
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 void RecordBookmarkLaunch(BookmarkLaunchLocation location) { 777 void RecordBookmarkLaunch(BookmarkLaunchLocation location) {
778 #if defined(OS_WIN) 778 #if defined(OS_WIN)
779 // TODO(estade): do this on other platforms too. For now it's compiled out 779 // TODO(estade): do this on other platforms too. For now it's compiled out
780 // so that stats from platforms for which this is incompletely implemented 780 // so that stats from platforms for which this is incompletely implemented
781 // don't mix in with Windows, where it should be implemented exhaustively. 781 // don't mix in with Windows, where it should be implemented exhaustively.
782 UMA_HISTOGRAM_ENUMERATION("Bookmarks.LaunchLocation", location, LAUNCH_LIMIT); 782 UMA_HISTOGRAM_ENUMERATION("Bookmarks.LaunchLocation", location, LAUNCH_LIMIT);
783 #endif 783 #endif
784 } 784 }
785 785
786 } // namespace bookmark_utils 786 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider.cc ('k') | chrome/browser/browser_about_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698