OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_bar_controller.h" | 5 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/find_bar/find_bar.h" | 14 #include "chrome/browser/ui/find_bar/find_bar.h" |
15 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 15 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
16 #include "chrome/browser/ui/find_bar/find_bar_state_factory.h" | 16 #include "chrome/browser/ui/find_bar/find_bar_state_factory.h" |
17 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 17 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
18 #include "content/public/browser/navigation_details.h" | 18 #include "content/public/browser/navigation_details.h" |
19 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
20 #include "content/public/browser/notification_details.h" | 20 #include "content/public/browser/notification_details.h" |
21 #include "content/public/browser/notification_source.h" | 21 #include "content/public/browser/notification_source.h" |
22 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
23 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
24 | 24 |
25 using content::NavigationController; | 25 using content::NavigationController; |
26 using content::WebContents; | 26 using content::WebContents; |
27 | 27 |
28 // The minimum space between the FindInPage window and the search result. | 28 // The minimum space between the FindInPage window and the search result. |
29 static const int kMinFindWndDistanceFromSelection = 5; | 29 static const int kMinFindWndDistanceFromSelection = 5; |
30 | 30 |
31 FindBarController::FindBarController(FindBar* find_bar) | 31 FindBarController::FindBarController(FindBar* find_bar) |
32 : find_bar_(find_bar), | 32 : find_bar_(find_bar), |
33 web_contents_(NULL), | 33 web_contents_(NULL), |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 250 } |
251 | 251 |
252 // Update the find bar with existing results and search text, regardless of | 252 // Update the find bar with existing results and search text, regardless of |
253 // whether or not the find bar is visible, so that if it's subsequently | 253 // whether or not the find bar is visible, so that if it's subsequently |
254 // shown it is showing the right state for this tab. We update the find text | 254 // shown it is showing the right state for this tab. We update the find text |
255 // _first_ since the FindBarView checks its emptiness to see if it should | 255 // _first_ since the FindBarView checks its emptiness to see if it should |
256 // clear the result count display when there's nothing in the box. | 256 // clear the result count display when there's nothing in the box. |
257 find_bar_->SetFindTextAndSelectedRange(find_string, | 257 find_bar_->SetFindTextAndSelectedRange(find_string, |
258 find_tab_helper->selected_range()); | 258 find_tab_helper->selected_range()); |
259 } | 259 } |
OLD | NEW |