Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/find_request_manager.h" | 5 #include "content/browser/find_request_manager.h" |
| 6 | 6 |
| 7 #include "content/browser/frame_host/render_frame_host_impl.h" | 7 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
| 9 #include "content/common/frame_messages.h" | 9 #include "content/common/frame_messages.h" |
| 10 #include "content/common/input_messages.h" | 10 #include "content/common/input_messages.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 int request_id, | 57 int request_id, |
| 58 int number_of_matches, | 58 int number_of_matches, |
| 59 const gfx::Rect& selection_rect, | 59 const gfx::Rect& selection_rect, |
| 60 int active_match_ordinal, | 60 int active_match_ordinal, |
| 61 bool final_update) { | 61 bool final_update) { |
| 62 // Ignore stale replies from abandoned find sessions. | 62 // Ignore stale replies from abandoned find sessions. |
| 63 if (current_session_id_ == kInvalidId || request_id < current_session_id_) | 63 if (current_session_id_ == kInvalidId || request_id < current_session_id_) |
| 64 return; | 64 return; |
| 65 | 65 |
| 66 // Update the stored results. | 66 // Update the stored results. |
| 67 number_of_matches_ = number_of_matches; | 67 if (number_of_matches != -1) |
| 68 selection_rect_ = selection_rect; | 68 number_of_matches_ = number_of_matches; |
| 69 active_match_ordinal_ = active_match_ordinal; | 69 if (!selection_rect.IsEmpty()) |
| 70 selection_rect_ = selection_rect; | |
| 71 if (active_match_ordinal > 0) | |
| 72 active_match_ordinal_ = active_match_ordinal; | |
|
nasko
2016/04/18 21:02:39
See my comment in the test file. Updating these co
paulmeyer
2016/04/19 15:15:00
This was intentional, and is something that FindRe
| |
| 70 | 73 |
| 71 NotifyFindReply(request_id, final_update); | 74 NotifyFindReply(request_id, final_update); |
| 72 } | 75 } |
| 73 | 76 |
| 74 #if defined(OS_ANDROID) | 77 #if defined(OS_ANDROID) |
| 75 void FindRequestManager::ActivateNearestFindResult(float x, | 78 void FindRequestManager::ActivateNearestFindResult(float x, |
| 76 float y) { | 79 float y) { |
| 77 if (current_session_id_ == kInvalidId) | 80 if (current_session_id_ == kInvalidId) |
| 78 return; | 81 return; |
| 79 | 82 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 } | 133 } |
| 131 | 134 |
| 132 #if defined(OS_ANDROID) | 135 #if defined(OS_ANDROID) |
| 133 void FindRequestManager::SendFindMatchRectsIPC(RenderFrameHost* rfh) { | 136 void FindRequestManager::SendFindMatchRectsIPC(RenderFrameHost* rfh) { |
| 134 rfh->Send(new FrameMsg_FindMatchRects(rfh->GetRoutingID(), | 137 rfh->Send(new FrameMsg_FindMatchRects(rfh->GetRoutingID(), |
| 135 match_rects_.request_version)); | 138 match_rects_.request_version)); |
| 136 } | 139 } |
| 137 #endif | 140 #endif |
| 138 | 141 |
| 139 } // namespace content | 142 } // namespace content |
| OLD | NEW |