| 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_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 "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if (last_search.find(current_search) != 0) | 123 if (last_search.find(current_search) != 0) |
| 124 find_bar_->AudibleAlert(); | 124 find_bar_->AudibleAlert(); |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { | 127 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { |
| 128 NavigationController* source_controller = | 128 NavigationController* source_controller = |
| 129 Source<NavigationController>(source).ptr(); | 129 Source<NavigationController>(source).ptr(); |
| 130 if (source_controller == &tab_contents_->controller()) { | 130 if (source_controller == &tab_contents_->controller()) { |
| 131 content::LoadCommittedDetails* commit_details = | 131 content::LoadCommittedDetails* commit_details = |
| 132 Details<content::LoadCommittedDetails>(details).ptr(); | 132 Details<content::LoadCommittedDetails>(details).ptr(); |
| 133 PageTransition::Type transition_type = | 133 content::PageTransition transition_type = |
| 134 commit_details->entry->transition_type(); | 134 commit_details->entry->transition_type(); |
| 135 // We hide the FindInPage window when the user navigates away, except on | 135 // We hide the FindInPage window when the user navigates away, except on |
| 136 // reload. | 136 // reload. |
| 137 if (find_bar_->IsFindBarVisible()) { | 137 if (find_bar_->IsFindBarVisible()) { |
| 138 if (PageTransition::StripQualifier(transition_type) != | 138 if (content::PageTransitionStripQualifier(transition_type) != |
| 139 PageTransition::RELOAD) { | 139 content::PAGE_TRANSITION_RELOAD) { |
| 140 EndFindSession(kKeepSelection); | 140 EndFindSession(kKeepSelection); |
| 141 } else { | 141 } else { |
| 142 // On Reload we want to make sure FindNext is converted to a full Find | 142 // On Reload we want to make sure FindNext is converted to a full Find |
| 143 // to make sure highlights for inactive matches are repainted. | 143 // to make sure highlights for inactive matches are repainted. |
| 144 find_tab_helper->set_find_op_aborted(true); | 144 find_tab_helper->set_find_op_aborted(true); |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 } | 149 } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // shown it is showing the right state for this tab. We update the find text | 229 // shown it is showing the right state for this tab. We update the find text |
| 230 // _first_ since the FindBarView checks its emptiness to see if it should | 230 // _first_ since the FindBarView checks its emptiness to see if it should |
| 231 // clear the result count display when there's nothing in the box. | 231 // clear the result count display when there's nothing in the box. |
| 232 find_bar_->SetFindText(find_string); | 232 find_bar_->SetFindText(find_string); |
| 233 #else | 233 #else |
| 234 // Having a per-tab find_string is not compatible with OS X's find pasteboard, | 234 // Having a per-tab find_string is not compatible with OS X's find pasteboard, |
| 235 // so we always have the same find text in all find bars. This is done through | 235 // so we always have the same find text in all find bars. This is done through |
| 236 // the find pasteboard mechanism, so don't set the text here. | 236 // the find pasteboard mechanism, so don't set the text here. |
| 237 #endif | 237 #endif |
| 238 } | 238 } |
| OLD | NEW |