Home | History | Annotate | Download | only in find_bar
      1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_UI_FIND_BAR_FIND_NOTIFICATION_DETAILS_H_
      6 #define CHROME_BROWSER_UI_FIND_BAR_FIND_NOTIFICATION_DETAILS_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "ui/gfx/rect.h"
     10 
     11 class FindNotificationDetails {
     12  public:
     13   FindNotificationDetails(int request_id,
     14                           int number_of_matches,
     15                           const gfx::Rect& selection_rect,
     16                           int active_match_ordinal,
     17                           bool final_update)
     18     : request_id_(request_id),
     19       number_of_matches_(number_of_matches),
     20       selection_rect_(selection_rect),
     21       active_match_ordinal_(active_match_ordinal),
     22       final_update_(final_update) {}
     23 
     24   FindNotificationDetails()
     25     : request_id_(0),
     26       number_of_matches_(-1),
     27       active_match_ordinal_(-1),
     28       final_update_(false) {}
     29 
     30   ~FindNotificationDetails() {}
     31 
     32   int request_id() const { return request_id_; }
     33 
     34   int number_of_matches() const { return number_of_matches_; }
     35 
     36   gfx::Rect selection_rect() const { return selection_rect_; }
     37 
     38   int active_match_ordinal() const { return active_match_ordinal_; }
     39 
     40   bool final_update() const { return final_update_; }
     41 
     42  private:
     43   int request_id_;    // The find-in-page request whose results we're returning.
     44   int number_of_matches_;  // How many matches were found.
     45   gfx::Rect selection_rect_;  // Where selection occurred (screen coordinate).
     46   int active_match_ordinal_;  // The ordinal of the currently selected match.
     47   bool final_update_;  // Whether this is the last Find Result update.
     48 };
     49 
     50 #endif  // CHROME_BROWSER_UI_FIND_BAR_FIND_NOTIFICATION_DETAILS_H_
     51