| 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 #ifndef CHROME_TEST_BASE_FIND_IN_PAGE_OBSERVER_H_ | 5 #ifndef CHROME_TEST_BASE_FIND_IN_PAGE_OBSERVER_H_ |
| 6 #define CHROME_TEST_BASE_FIND_IN_PAGE_OBSERVER_H_ | 6 #define CHROME_TEST_BASE_FIND_IN_PAGE_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 void Wait(); | 33 void Wait(); |
| 34 | 34 |
| 35 int active_match_ordinal() const { return active_match_ordinal_; } | 35 int active_match_ordinal() const { return active_match_ordinal_; } |
| 36 int number_of_matches() const { return number_of_matches_; } | 36 int number_of_matches() const { return number_of_matches_; } |
| 37 gfx::Rect selection_rect() const { return selection_rect_; } | 37 gfx::Rect selection_rect() const { return selection_rect_; } |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 virtual void Observe(int type, | 40 virtual void Observe(int type, |
| 41 const content::NotificationSource& source, | 41 const content::NotificationSource& source, |
| 42 const content::NotificationDetails& details) OVERRIDE; | 42 const content::NotificationDetails& details) override; |
| 43 | 43 |
| 44 content::NotificationRegistrar registrar_; | 44 content::NotificationRegistrar registrar_; |
| 45 // We will at some point (before final update) be notified of the ordinal and | 45 // We will at some point (before final update) be notified of the ordinal and |
| 46 // we need to preserve it so we can send it later. | 46 // we need to preserve it so we can send it later. |
| 47 int active_match_ordinal_; | 47 int active_match_ordinal_; |
| 48 int number_of_matches_; | 48 int number_of_matches_; |
| 49 gfx::Rect selection_rect_; | 49 gfx::Rect selection_rect_; |
| 50 // The id of the current find request, obtained from WebContents. Allows us | 50 // The id of the current find request, obtained from WebContents. Allows us |
| 51 // to monitor when the search completes. | 51 // to monitor when the search completes. |
| 52 int current_find_request_id_; | 52 int current_find_request_id_; |
| 53 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 53 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
| 54 | 54 |
| 55 bool seen_; // true after transition to expected state has been seen | 55 bool seen_; // true after transition to expected state has been seen |
| 56 bool running_; // indicates whether message loop is running | 56 bool running_; // indicates whether message loop is running |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(FindInPageNotificationObserver); | 58 DISALLOW_COPY_AND_ASSIGN(FindInPageNotificationObserver); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace ui_test_utils | 61 } // namespace ui_test_utils |
| 62 | 62 |
| 63 #endif // CHROME_TEST_BASE_FIND_IN_PAGE_OBSERVER_H_ | 63 #endif // CHROME_TEST_BASE_FIND_IN_PAGE_OBSERVER_H_ |
| OLD | NEW |