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

Side by Side Diff: chrome/renderer/searchbox/searchbox.h

Issue 11413217: Instant API: tell page whether the browser is capturing key strokes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@focus
Patch Set: Finish renaming. Created 8 years 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ 5 #ifndef CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
6 #define CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ 6 #define CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 26 matching lines...) Expand all
37 void StartCapturingKeyStrokes(); 37 void StartCapturingKeyStrokes();
38 38
39 // Sends ViewHostMsg_StopCapturingKeyStrokes to the browser. 39 // Sends ViewHostMsg_StopCapturingKeyStrokes to the browser.
40 void StopCapturingKeyStrokes(); 40 void StopCapturingKeyStrokes();
41 41
42 const string16& query() const { return query_; } 42 const string16& query() const { return query_; }
43 bool verbatim() const { return verbatim_; } 43 bool verbatim() const { return verbatim_; }
44 size_t selection_start() const { return selection_start_; } 44 size_t selection_start() const { return selection_start_; }
45 size_t selection_end() const { return selection_end_; } 45 size_t selection_end() const { return selection_end_; }
46 int results_base() const { return results_base_; } 46 int results_base() const { return results_base_; }
47 bool is_key_capture_enabled() const { return is_key_capture_enabled_; }
47 const chrome::search::Mode& mode() const { return mode_; } 48 const chrome::search::Mode& mode() const { return mode_; }
48 49
49 gfx::Rect GetRect(); 50 gfx::Rect GetRect();
50 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults(); 51 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults();
51 // Searchbox retains ownership of this object. 52 // Searchbox retains ownership of this object.
52 const InstantAutocompleteResult* 53 const InstantAutocompleteResult*
53 GetAutocompleteResultWithId(size_t restricted_id) const; 54 GetAutocompleteResultWithId(size_t restricted_id) const;
54 const ThemeBackgroundInfo& GetThemeBackgroundInfo(); 55 const ThemeBackgroundInfo& GetThemeBackgroundInfo();
55 int GetThemeAreaHeight(); 56 int GetThemeAreaHeight();
56 57
57 private: 58 private:
58 // Overridden from content::RenderViewObserver: 59 // Overridden from content::RenderViewObserver:
59 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 60 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
60 61
61 void OnChange(const string16& query, 62 void OnChange(const string16& query,
62 bool verbatim, 63 bool verbatim,
63 size_t selection_start, 64 size_t selection_start,
64 size_t selection_end); 65 size_t selection_end);
65 void OnSubmit(const string16& query); 66 void OnSubmit(const string16& query);
66 void OnCancel(const string16& query); 67 void OnCancel(const string16& query);
67 void OnResize(const gfx::Rect& bounds); 68 void OnResize(const gfx::Rect& bounds);
68 void OnDetermineIfPageSupportsInstant(); 69 void OnDetermineIfPageSupportsInstant();
69 void OnAutocompleteResults( 70 void OnAutocompleteResults(
70 const std::vector<InstantAutocompleteResult>& results); 71 const std::vector<InstantAutocompleteResult>& results);
71 void OnUpOrDownKeyPressed(int count); 72 void OnUpOrDownKeyPressed(int count);
73 void OnKeyCaptureChange(bool is_key_capture_enabled);
72 void OnModeChanged(const chrome::search::Mode& mode); 74 void OnModeChanged(const chrome::search::Mode& mode);
73 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); 75 void OnThemeChanged(const ThemeBackgroundInfo& theme_info);
74 void OnThemeAreaHeightChanged(int height); 76 void OnThemeAreaHeightChanged(int height);
75 77
76 // Sets the searchbox values to their initial value. 78 // Sets the searchbox values to their initial value.
77 void Reset(); 79 void Reset();
78 80
79 string16 query_; 81 string16 query_;
80 bool verbatim_; 82 bool verbatim_;
81 size_t selection_start_; 83 size_t selection_start_;
82 size_t selection_end_; 84 size_t selection_end_;
83 size_t results_base_; 85 size_t results_base_;
84 gfx::Rect rect_; 86 gfx::Rect rect_;
85 std::vector<InstantAutocompleteResult> autocomplete_results_; 87 std::vector<InstantAutocompleteResult> autocomplete_results_;
86 size_t last_results_base_; 88 size_t last_results_base_;
87 std::vector<InstantAutocompleteResult> last_autocomplete_results_; 89 std::vector<InstantAutocompleteResult> last_autocomplete_results_;
90 bool is_key_capture_enabled_;
88 chrome::search::Mode mode_; 91 chrome::search::Mode mode_;
89 ThemeBackgroundInfo theme_info_; 92 ThemeBackgroundInfo theme_info_;
90 int theme_area_height_; 93 int theme_area_height_;
91 94
92 DISALLOW_COPY_AND_ASSIGN(SearchBox); 95 DISALLOW_COPY_AND_ASSIGN(SearchBox);
93 }; 96 };
94 97
95 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ 98 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698