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

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

Issue 2800163002: Prevent excessive beeping in case of Find On Page search failure
Patch Set: Move tracking to find_tab_helper Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/find_bar/find_tab_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 12 matching lines...) Expand all
23 #include "content/public/browser/web_contents.h" 23 #include "content/public/browser/web_contents.h"
24 #include "ui/gfx/geometry/rect.h" 24 #include "ui/gfx/geometry/rect.h"
25 25
26 using content::NavigationController; 26 using content::NavigationController;
27 using content::WebContents; 27 using content::WebContents;
28 28
29 // The minimum space between the FindInPage window and the search result. 29 // The minimum space between the FindInPage window and the search result.
30 static const int kMinFindWndDistanceFromSelection = 5; 30 static const int kMinFindWndDistanceFromSelection = 5;
31 31
32 FindBarController::FindBarController(FindBar* find_bar) 32 FindBarController::FindBarController(FindBar* find_bar)
33 : find_bar_(find_bar), 33 : find_bar_(find_bar), web_contents_(NULL), last_reported_matchcount_(0) {}
34 web_contents_(NULL),
35 last_reported_matchcount_(0) {
36 }
37 34
38 FindBarController::~FindBarController() { 35 FindBarController::~FindBarController() {
39 DCHECK(!web_contents_); 36 DCHECK(!web_contents_);
40 } 37 }
41 38
42 void FindBarController::Show() { 39 void FindBarController::Show() {
43 FindTabHelper* find_tab_helper = 40 FindTabHelper* find_tab_helper =
44 FindTabHelper::FromWebContents(web_contents_); 41 FindTabHelper::FromWebContents(web_contents_);
45 42
46 // Only show the animation if we're not already showing a find bar for the 43 // Only show the animation if we're not already showing a find bar for the
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 250 }
254 251
255 // 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
256 // 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
257 // 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
258 // _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
259 // 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.
260 find_bar_->SetFindTextAndSelectedRange(find_string, 257 find_bar_->SetFindTextAndSelectedRange(find_string,
261 find_tab_helper->selected_range()); 258 find_tab_helper->selected_range());
262 } 259 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/find_bar/find_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698