| OLD | NEW |
| 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 Loading... |
| 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 | 62 |
| 62 void OnChange(const string16& query, | 63 void OnChange(const string16& query, |
| 63 bool verbatim, | 64 bool verbatim, |
| 64 size_t selection_start, | 65 size_t selection_start, |
| 65 size_t selection_end); | 66 size_t selection_end); |
| 66 void OnSubmit(const string16& query); | 67 void OnSubmit(const string16& query); |
| 67 void OnCancel(const string16& query); | 68 void OnCancel(const string16& query); |
| 68 void OnResize(const gfx::Rect& bounds); | 69 void OnResize(const gfx::Rect& bounds); |
| 69 void OnDetermineIfPageSupportsInstant(); | 70 void OnDetermineIfPageSupportsInstant(); |
| 70 void OnAutocompleteResults( | 71 void OnAutocompleteResults( |
| 71 const std::vector<InstantAutocompleteResult>& results); | 72 const std::vector<InstantAutocompleteResult>& results); |
| 72 void OnUpOrDownKeyPressed(int count); | 73 void OnUpOrDownKeyPressed(int count); |
| 74 void OnKeyCaptureChange(bool is_key_capture_enabled); |
| 73 void OnModeChanged(const chrome::search::Mode& mode); | 75 void OnModeChanged(const chrome::search::Mode& mode); |
| 74 void OnSetDisplayInstantResults(bool display_instant_results); | 76 void OnSetDisplayInstantResults(bool display_instant_results); |
| 75 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); | 77 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); |
| 76 void OnThemeAreaHeightChanged(int height); | 78 void OnThemeAreaHeightChanged(int height); |
| 77 | 79 |
| 78 // Sets the searchbox values to their initial value. | 80 // Sets the searchbox values to their initial value. |
| 79 void Reset(); | 81 void Reset(); |
| 80 | 82 |
| 81 string16 query_; | 83 string16 query_; |
| 82 bool verbatim_; | 84 bool verbatim_; |
| 83 size_t selection_start_; | 85 size_t selection_start_; |
| 84 size_t selection_end_; | 86 size_t selection_end_; |
| 85 size_t results_base_; | 87 size_t results_base_; |
| 86 gfx::Rect rect_; | 88 gfx::Rect rect_; |
| 87 std::vector<InstantAutocompleteResult> autocomplete_results_; | 89 std::vector<InstantAutocompleteResult> autocomplete_results_; |
| 88 size_t last_results_base_; | 90 size_t last_results_base_; |
| 89 std::vector<InstantAutocompleteResult> last_autocomplete_results_; | 91 std::vector<InstantAutocompleteResult> last_autocomplete_results_; |
| 92 bool is_key_capture_enabled_; |
| 90 chrome::search::Mode mode_; | 93 chrome::search::Mode mode_; |
| 91 ThemeBackgroundInfo theme_info_; | 94 ThemeBackgroundInfo theme_info_; |
| 92 int theme_area_height_; | 95 int theme_area_height_; |
| 93 bool display_instant_results_; | 96 bool display_instant_results_; |
| 94 | 97 |
| 95 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 98 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
| 96 }; | 99 }; |
| 97 | 100 |
| 98 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 101 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
| OLD | NEW |