1// Copyright 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
5package org.chromium.chrome.browser;
6
7import 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 */
13public 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(int numberOfMatches, Rect rendererSelectionRect,
33            int activeMatchOrdinal, boolean finalUpdate) {
34        this.numberOfMatches = numberOfMatches;
35        this.rendererSelectionRect = rendererSelectionRect;
36        this.activeMatchOrdinal = activeMatchOrdinal;
37        this.finalUpdate = finalUpdate;
38    }
39}
40