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

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: Fix tests. 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 27 matching lines...) Expand all
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 const chrome::search::Mode& mode() const { return mode_; } 47 const chrome::search::Mode& mode() const { return mode_; }
48 bool is_key_capture_enabled() const { return is_key_capture_enabled_; }
48 bool display_instant_results() const { return display_instant_results_; } 49 bool display_instant_results() const { return display_instant_results_; }
49 50
50 gfx::Rect GetRect(); 51 gfx::Rect GetRect();
51 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults(); 52 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults();
52 // Searchbox retains ownership of this object. 53 // Searchbox retains ownership of this object.
53 const InstantAutocompleteResult* 54 const InstantAutocompleteResult*
54 GetAutocompleteResultWithId(size_t restricted_id) const; 55 GetAutocompleteResultWithId(size_t restricted_id) const;
55 const ThemeBackgroundInfo& GetThemeBackgroundInfo(); 56 const ThemeBackgroundInfo& GetThemeBackgroundInfo();
56 int GetThemeAreaHeight(); 57 int GetThemeAreaHeight();
57 58
58 private: 59 private:
59 // Overridden from content::RenderViewObserver: 60 // Overridden from content::RenderViewObserver:
60 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 61 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
61 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; 62 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE;
62 63
63 void OnChange(const string16& query, 64 void OnChange(const string16& query,
64 bool verbatim, 65 bool verbatim,
65 size_t selection_start, 66 size_t selection_start,
66 size_t selection_end); 67 size_t selection_end);
67 void OnSubmit(const string16& query); 68 void OnSubmit(const string16& query);
68 void OnCancel(const string16& query); 69 void OnCancel(const string16& query);
69 void OnResize(const gfx::Rect& bounds); 70 void OnResize(const gfx::Rect& bounds);
70 void OnDetermineIfPageSupportsInstant(); 71 void OnDetermineIfPageSupportsInstant();
71 void OnAutocompleteResults( 72 void OnAutocompleteResults(
72 const std::vector<InstantAutocompleteResult>& results); 73 const std::vector<InstantAutocompleteResult>& results);
73 void OnUpOrDownKeyPressed(int count); 74 void OnUpOrDownKeyPressed(int count);
75 void OnKeyCaptureChange(bool is_key_capture_enabled);
74 void OnModeChanged(const chrome::search::Mode& mode); 76 void OnModeChanged(const chrome::search::Mode& mode);
75 void OnSetDisplayInstantResults(bool display_instant_results); 77 void OnSetDisplayInstantResults(bool display_instant_results);
76 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); 78 void OnThemeChanged(const ThemeBackgroundInfo& theme_info);
77 void OnThemeAreaHeightChanged(int height); 79 void OnThemeAreaHeightChanged(int height);
78 80
79 // Sets the searchbox values to their initial value. 81 // Sets the searchbox values to their initial value.
80 void Reset(); 82 void Reset();
81 83
82 string16 query_; 84 string16 query_;
83 bool verbatim_; 85 bool verbatim_;
84 size_t selection_start_; 86 size_t selection_start_;
85 size_t selection_end_; 87 size_t selection_end_;
86 size_t results_base_; 88 size_t results_base_;
87 gfx::Rect rect_; 89 gfx::Rect rect_;
88 std::vector<InstantAutocompleteResult> autocomplete_results_; 90 std::vector<InstantAutocompleteResult> autocomplete_results_;
89 size_t last_results_base_; 91 size_t last_results_base_;
90 std::vector<InstantAutocompleteResult> last_autocomplete_results_; 92 std::vector<InstantAutocompleteResult> last_autocomplete_results_;
93 bool is_key_capture_enabled_;
91 chrome::search::Mode mode_; 94 chrome::search::Mode mode_;
92 ThemeBackgroundInfo theme_info_; 95 ThemeBackgroundInfo theme_info_;
93 int theme_area_height_; 96 int theme_area_height_;
94 bool display_instant_results_; 97 bool display_instant_results_;
95 98
96 DISALLOW_COPY_AND_ASSIGN(SearchBox); 99 DISALLOW_COPY_AND_ASSIGN(SearchBox);
97 }; 100 };
98 101
99 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ 102 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/searchbox_api.js ('k') | chrome/renderer/searchbox/searchbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698