| 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | package org.chromium.chrome.browser; |
| 6 | |
| 7 | import android.graphics.Rect; |
| 8 | |
| 9 | /** |
| 10 | * Java equivalent to the C++ FindNotificationDetails class |
| 11 | * defined in chrome/browser/ui/find_bar/find_notification_details.h |
| 12 | */ |
| 13 | public class FindNotificationDetails { |
| 14 | /** How many matches were found. */ |
| 15 | public final int numberOfMatches; |
| 16 | |
| 17 | /** Where selection occurred (in renderer window coordinates). */ |
| 18 | public final Rect rendererSelectionRect; |
| 19 | |
| 20 | /** |
| 21 | * The ordinal of the currently selected match. |
| 22 | * |
| 23 | * Might be -1 even with matches in rare edge cases where the active match |
| 24 | * has been removed from DOM by the time the active ordinals are processed. |
| 25 | * This indicates we failed to locate and highlight the active match. |
| 26 | */ |
| 27 | public final int activeMatchOrdinal; |
| 28 | |
| 29 | /** Whether this is the last Find Result update for the request. */ |
| 30 | public final boolean finalUpdate; |
| 31 | |
| 32 | public FindNotificationDetails( |
| 33 | int numberOfMatches, Rect rendererSelectionRect, |
| 34 | int activeMatchOrdinal, boolean finalUpdate) { |
| 35 | this.numberOfMatches = numberOfMatches; |
| 36 | this.rendererSelectionRect = rendererSelectionRect; |
| 37 | this.activeMatchOrdinal = activeMatchOrdinal; |
| 38 | this.finalUpdate = finalUpdate; |
| 39 | } |
| 40 | } |