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

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

Issue 6356004: If the user selects text in the current tab, and types CTRL-F,... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
11 #include "base/string16.h"
11 #include "chrome/common/notification_observer.h" 12 #include "chrome/common/notification_observer.h"
12 #include "chrome/common/notification_registrar.h" 13 #include "chrome/common/notification_registrar.h"
13 14
14 namespace gfx { 15 namespace gfx {
15 class Rect; 16 class Rect;
16 } 17 }
17 18
18 class FindBar; 19 class FindBar;
19 class TabContents; 20 class TabContents;
20 21
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // de-flickering in addition to just calling the update function. 66 // de-flickering in addition to just calling the update function.
66 void UpdateFindBarForCurrentResult(); 67 void UpdateFindBarForCurrentResult();
67 68
68 // For Windows and Linux this function sets the prepopulate text for the 69 // For Windows and Linux this function sets the prepopulate text for the
69 // Find text box. The propopulate value is the last value the user searched 70 // Find text box. The propopulate value is the last value the user searched
70 // for in the current tab, or (if blank) the last value searched for in any 71 // for in the current tab, or (if blank) the last value searched for in any
71 // tab. Mac has a global value for search, so this function does nothing on 72 // tab. Mac has a global value for search, so this function does nothing on
72 // Mac. 73 // Mac.
73 void MaybeSetPrepopulateText(); 74 void MaybeSetPrepopulateText();
74 75
76 // For Windows and Linux this function sets the find text to the text that is
77 // selected in the current tab, if there is any such text. Mac has a global
78 // value for search, so this function does nothing on Mac.
79 void MaybeOverrideText();
80
81 // Gets the text that is selected in the current tab, or an empty string.
82 string16 GetSelectedText();
83
75 NotificationRegistrar registrar_; 84 NotificationRegistrar registrar_;
76 85
77 scoped_ptr<FindBar> find_bar_; 86 scoped_ptr<FindBar> find_bar_;
78 87
79 // The TabContents we are currently associated with. Can be NULL. 88 // The TabContents we are currently associated with. Can be NULL.
80 TabContents* tab_contents_; 89 TabContents* tab_contents_;
81 90
82 // The last match count we reported to the user. This is used by 91 // The last match count we reported to the user. This is used by
83 // UpdateFindBarForCurrentResult to avoid flickering. 92 // UpdateFindBarForCurrentResult to avoid flickering.
84 int last_reported_matchcount_; 93 int last_reported_matchcount_;
85 94
86 DISALLOW_COPY_AND_ASSIGN(FindBarController); 95 DISALLOW_COPY_AND_ASSIGN(FindBarController);
87 }; 96 };
88 97
89 #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_ 98 #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.cc ('k') | chrome/browser/ui/find_bar/find_bar_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698