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

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

Issue 372017: Fix various problems with inline autocomplete and URLs that change length dur... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/clipboard/clipboard.h" 7 #include "app/clipboard/clipboard.h"
8 #include "app/drag_drop_types.h" 8 #include "app/drag_drop_types.h"
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/tree_node_iterator.h" 10 #include "app/tree_node_iterator.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // Returns true if |node|s title or url contains the strings in |words|. 180 // Returns true if |node|s title or url contains the strings in |words|.
181 // |languages| argument is user's accept-language setting to decode IDN. 181 // |languages| argument is user's accept-language setting to decode IDN.
182 bool DoesBookmarkContainWords(const BookmarkNode* node, 182 bool DoesBookmarkContainWords(const BookmarkNode* node,
183 const std::vector<std::wstring>& words, 183 const std::vector<std::wstring>& words,
184 const std::wstring& languages) { 184 const std::wstring& languages) {
185 return 185 return
186 DoesBookmarkTextContainWords( 186 DoesBookmarkTextContainWords(
187 l10n_util::ToLower(node->GetTitle()), words) || 187 l10n_util::ToLower(node->GetTitle()), words) ||
188 DoesBookmarkTextContainWords(UTF8ToWide(node->GetURL().spec()), words) || 188 DoesBookmarkTextContainWords(UTF8ToWide(node->GetURL().spec()), words) ||
189 DoesBookmarkTextContainWords(net::FormatUrl( 189 DoesBookmarkTextContainWords(net::FormatUrl(
190 node->GetURL(), languages, false, true, NULL, NULL), words); 190 node->GetURL(), languages, false, true, NULL, NULL, NULL), words);
191 } 191 }
192 192
193 } // namespace 193 } // namespace
194 194
195 namespace bookmark_utils { 195 namespace bookmark_utils {
196 196
197 int num_urls_before_prompting = 15; 197 int num_urls_before_prompting = 15;
198 198
199 int PreferredDropOperation(int source_operations, int operations) { 199 int PreferredDropOperation(int source_operations, int operations) {
200 int common_ops = (source_operations & operations); 200 int common_ops = (source_operations & operations);
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 std::vector<std::pair<GURL, std::wstring> >* urls) { 646 std::vector<std::pair<GURL, std::wstring> >* urls) {
647 for (int i = 0; i < browser->tab_count(); ++i) { 647 for (int i = 0; i < browser->tab_count(); ++i) {
648 std::pair<GURL, std::wstring> entry; 648 std::pair<GURL, std::wstring> entry;
649 GetURLAndTitleToBookmark(browser->GetTabContentsAt(i), &(entry.first), 649 GetURLAndTitleToBookmark(browser->GetTabContentsAt(i), &(entry.first),
650 &(entry.second)); 650 &(entry.second));
651 urls->push_back(entry); 651 urls->push_back(entry);
652 } 652 }
653 } 653 }
654 654
655 } // namespace bookmark_utils 655 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_table_model.cc ('k') | chrome/browser/gtk/options/exceptions_page_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698