| 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 5178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5189 return; | 5189 return; |
| 5190 } | 5190 } |
| 5191 | 5191 |
| 5192 WebRect selection_rect; | 5192 WebRect selection_rect; |
| 5193 bool active_now = false; | 5193 bool active_now = false; |
| 5194 | 5194 |
| 5195 // If something is selected when we start searching it means we cannot just | 5195 // If something is selected when we start searching it means we cannot just |
| 5196 // increment the current match ordinal; we need to re-generate it. | 5196 // increment the current match ordinal; we need to re-generate it. |
| 5197 WebRange current_selection = frame_->selectionRange(); | 5197 WebRange current_selection = frame_->selectionRange(); |
| 5198 | 5198 |
| 5199 if (frame_->find(request_id, search_text, options, | 5199 bool result = frame_->find(request_id, search_text, options, |
| 5200 false /* wrapWithinFrame */, &selection_rect, &active_now)) { | 5200 false /* wrapWithinFrame */, &selection_rect, |
| 5201 &active_now); |
| 5202 if (result && !options.findNext) { |
| 5201 // Indicate that at least one match has been found. 1 here means possibly | 5203 // Indicate that at least one match has been found. 1 here means possibly |
| 5202 // more matches could be coming. -1 here means that the exact active match | 5204 // more matches could be coming. -1 here means that the exact active match |
| 5203 // ordinal is not yet known. | 5205 // ordinal is not yet known. |
| 5204 SendFindReply(request_id, 1 /* match_count */, -1 /* ordinal */, | 5206 SendFindReply(request_id, 1 /* match_count */, -1 /* ordinal */, |
| 5205 gfx::Rect(), false /* final_status_update */ ); | 5207 gfx::Rect(), false /* final_status_update */ ); |
| 5206 } | 5208 } |
| 5207 | 5209 |
| 5208 if (options.findNext && current_selection.isNull() && active_now) { | 5210 if (options.findNext && current_selection.isNull() && active_now) { |
| 5209 // Force report of the actual count. | 5211 // Force report of the actual count. |
| 5210 frame_->increaseMatchCount(0, request_id); | 5212 frame_->increaseMatchCount(0, request_id); |
| (...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6328 // event target. Potentially a Pepper plugin will receive the event. | 6330 // event target. Potentially a Pepper plugin will receive the event. |
| 6329 // In order to tell whether a plugin gets the last mouse event and which it | 6331 // In order to tell whether a plugin gets the last mouse event and which it |
| 6330 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6332 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6331 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6333 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6332 // |pepper_last_mouse_event_target_|. | 6334 // |pepper_last_mouse_event_target_|. |
| 6333 pepper_last_mouse_event_target_ = nullptr; | 6335 pepper_last_mouse_event_target_ = nullptr; |
| 6334 #endif | 6336 #endif |
| 6335 } | 6337 } |
| 6336 | 6338 |
| 6337 } // namespace content | 6339 } // namespace content |
| OLD | NEW |