Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: chrome/browser/ui/find_bar/find_bar_controller.cc

Issue 562603002: Move PageTransition from //content/public/common to //ui/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 if (last_search.find(current_search) != 0) 146 if (last_search.find(current_search) != 0)
147 find_bar_->AudibleAlert(); 147 find_bar_->AudibleAlert();
148 } 148 }
149 } 149 }
150 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { 150 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) {
151 NavigationController* source_controller = 151 NavigationController* source_controller =
152 content::Source<NavigationController>(source).ptr(); 152 content::Source<NavigationController>(source).ptr();
153 if (source_controller == &web_contents_->GetController()) { 153 if (source_controller == &web_contents_->GetController()) {
154 content::LoadCommittedDetails* commit_details = 154 content::LoadCommittedDetails* commit_details =
155 content::Details<content::LoadCommittedDetails>(details).ptr(); 155 content::Details<content::LoadCommittedDetails>(details).ptr();
156 content::PageTransition transition_type = 156 ui::PageTransition transition_type =
157 commit_details->entry->GetTransitionType(); 157 commit_details->entry->GetTransitionType();
158 // Hide the find bar on reload or navigation. 158 // Hide the find bar on reload or navigation.
159 if (find_bar_->IsFindBarVisible() && 159 if (find_bar_->IsFindBarVisible() &&
160 (content::PageTransitionStripQualifier(transition_type) == 160 (ui::PageTransitionStripQualifier(transition_type) ==
161 content::PAGE_TRANSITION_RELOAD || 161 ui::PAGE_TRANSITION_RELOAD ||
162 commit_details->is_navigation_to_different_page())) 162 commit_details->is_navigation_to_different_page()))
163 EndFindSession(kKeepSelectionOnPage, kClearResultsInFindBox); 163 EndFindSession(kKeepSelectionOnPage, kClearResultsInFindBox);
164 } 164 }
165 } 165 }
166 } 166 }
167 167
168 // static 168 // static
169 gfx::Rect FindBarController::GetLocationForFindbarView( 169 gfx::Rect FindBarController::GetLocationForFindbarView(
170 gfx::Rect view_location, 170 gfx::Rect view_location,
171 const gfx::Rect& dialog_bounds, 171 const gfx::Rect& dialog_bounds,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/extensions/extension_install_ui_default.cc ('k') | chrome/browser/ui/find_bar/find_bar_host_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698