| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/find_bar/find_tab_helper.h" | 5 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 10 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
| 11 #include "content/browser/renderer_host/render_view_host.h" | 11 #include "content/browser/renderer_host/render_view_host.h" |
| 12 #include "content/browser/tab_contents/tab_contents.h" | 12 #include "content/browser/tab_contents/tab_contents.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "content/common/notification_service.h" | 14 #include "content/public/browser/notification_service.h" |
| 15 #include "content/common/view_message_enums.h" | 15 #include "content/common/view_message_enums.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" |
| 17 | 17 |
| 18 using WebKit::WebFindOptions; | 18 using WebKit::WebFindOptions; |
| 19 | 19 |
| 20 // static | 20 // static |
| 21 int FindTabHelper::find_request_id_counter_ = -1; | 21 int FindTabHelper::find_request_id_counter_ = -1; |
| 22 | 22 |
| 23 FindTabHelper::FindTabHelper(TabContents* tab_contents) | 23 FindTabHelper::FindTabHelper(TabContents* tab_contents) |
| 24 : TabContentsObserver(tab_contents), | 24 : TabContentsObserver(tab_contents), |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 gfx::Rect selection = selection_rect; | 140 gfx::Rect selection = selection_rect; |
| 141 if (selection.IsEmpty()) | 141 if (selection.IsEmpty()) |
| 142 selection = last_search_result_.selection_rect(); | 142 selection = last_search_result_.selection_rect(); |
| 143 | 143 |
| 144 // Notify the UI, automation and any other observers that a find result was | 144 // Notify the UI, automation and any other observers that a find result was |
| 145 // found. | 145 // found. |
| 146 last_search_result_ = FindNotificationDetails( | 146 last_search_result_ = FindNotificationDetails( |
| 147 request_id, number_of_matches, selection, active_match_ordinal, | 147 request_id, number_of_matches, selection, active_match_ordinal, |
| 148 final_update); | 148 final_update); |
| 149 NotificationService::current()->Notify( | 149 content::NotificationService::current()->Notify( |
| 150 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, | 150 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, |
| 151 content::Source<TabContents>(tab_contents()), | 151 content::Source<TabContents>(tab_contents()), |
| 152 content::Details<FindNotificationDetails>(&last_search_result_)); | 152 content::Details<FindNotificationDetails>(&last_search_result_)); |
| 153 } | 153 } |
| 154 } | 154 } |
| OLD | NEW |