OLD | NEW |
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_index.h" | 5 #include "components/bookmarks/core/browser/bookmark_index.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <iterator> | 9 #include <iterator> |
10 #include <list> | 10 #include <list> |
11 | 11 |
12 #include "base/i18n/case_conversion.h" | 12 #include "base/i18n/case_conversion.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "chrome/browser/bookmarks/bookmark_utils.h" | |
16 #include "components/bookmarks/core/browser/bookmark_client.h" | 15 #include "components/bookmarks/core/browser/bookmark_client.h" |
17 #include "components/bookmarks/core/browser/bookmark_match.h" | 16 #include "components/bookmarks/core/browser/bookmark_match.h" |
18 #include "components/bookmarks/core/browser/bookmark_node.h" | 17 #include "components/bookmarks/core/browser/bookmark_node.h" |
| 18 #include "components/bookmarks/core/browser/bookmark_utils.h" |
19 #include "components/query_parser/query_parser.h" | 19 #include "components/query_parser/query_parser.h" |
20 #include "components/query_parser/snippet.h" | 20 #include "components/query_parser/snippet.h" |
21 #include "third_party/icu/source/common/unicode/normalizer2.h" | 21 #include "third_party/icu/source/common/unicode/normalizer2.h" |
22 | 22 |
23 typedef BookmarkClient::NodeTypedCountPair NodeTypedCountPair; | 23 typedef BookmarkClient::NodeTypedCountPair NodeTypedCountPair; |
24 typedef BookmarkClient::NodeTypedCountPairs NodeTypedCountPairs; | 24 typedef BookmarkClient::NodeTypedCountPairs NodeTypedCountPairs; |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 // Returns a normalized version of the UTF16 string |text|. If it fails to | 28 // Returns a normalized version of the UTF16 string |text|. If it fails to |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 Index::iterator i = index_.find(term); | 347 Index::iterator i = index_.find(term); |
348 if (i == index_.end()) { | 348 if (i == index_.end()) { |
349 // We can get here if the node has the same term more than once. For | 349 // We can get here if the node has the same term more than once. For |
350 // example, a bookmark with the title 'foo foo' would end up here. | 350 // example, a bookmark with the title 'foo foo' would end up here. |
351 return; | 351 return; |
352 } | 352 } |
353 i->second.erase(node); | 353 i->second.erase(node); |
354 if (i->second.empty()) | 354 if (i->second.empty()) |
355 index_.erase(i); | 355 index_.erase(i); |
356 } | 356 } |
OLD | NEW |