| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/bookmarks/bookmark_bridge.h" | 5 #include "chrome/browser/android/bookmarks/bookmark_bridge.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 jint max_results) { | 586 jint max_results) { |
| 587 DCHECK(bookmark_model_->loaded()); | 587 DCHECK(bookmark_model_->loaded()); |
| 588 | 588 |
| 589 std::vector<bookmarks::BookmarkMatch> results; | 589 std::vector<bookmarks::BookmarkMatch> results; |
| 590 bookmark_model_->GetBookmarksMatching( | 590 bookmark_model_->GetBookmarksMatching( |
| 591 base::android::ConvertJavaStringToUTF16(env, j_query), | 591 base::android::ConvertJavaStringToUTF16(env, j_query), |
| 592 max_results, | 592 max_results, |
| 593 query_parser::MatchingAlgorithm::ALWAYS_PREFIX_SEARCH, | 593 query_parser::MatchingAlgorithm::ALWAYS_PREFIX_SEARCH, |
| 594 &results); | 594 &results); |
| 595 for (const bookmarks::BookmarkMatch& match : results) { | 595 for (const bookmarks::BookmarkMatch& match : results) { |
| 596 const BookmarkNode* node = match.node; | 596 const BookmarkNode* node = static_cast<const BookmarkNode*>(match.node); |
| 597 | 597 |
| 598 std::vector<int> title_match_start_positions; | 598 std::vector<int> title_match_start_positions; |
| 599 std::vector<int> title_match_end_positions; | 599 std::vector<int> title_match_end_positions; |
| 600 for (auto position : match.title_match_positions) { | 600 for (auto position : match.title_match_positions) { |
| 601 title_match_start_positions.push_back(position.first); | 601 title_match_start_positions.push_back(position.first); |
| 602 title_match_end_positions.push_back(position.second); | 602 title_match_end_positions.push_back(position.second); |
| 603 } | 603 } |
| 604 | 604 |
| 605 std::vector<int> url_match_start_positions; | 605 std::vector<int> url_match_start_positions; |
| 606 std::vector<int> url_match_end_positions; | 606 std::vector<int> url_match_end_positions; |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 BookmarkModelChanged(); | 1031 BookmarkModelChanged(); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 void BookmarkBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { | 1034 void BookmarkBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { |
| 1035 NotifyIfDoneLoading(); | 1035 NotifyIfDoneLoading(); |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 void BookmarkBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { | 1038 void BookmarkBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { |
| 1039 partner_bookmarks_shim_ = NULL; | 1039 partner_bookmarks_shim_ = NULL; |
| 1040 } | 1040 } |
| OLD | NEW |