| 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 26 matching lines...) Expand all Loading... |
| 37 size_t selection_start() const { return selection_start_; } | 37 size_t selection_start() const { return selection_start_; } |
| 38 size_t selection_end() const { return selection_end_; } | 38 size_t selection_end() const { return selection_end_; } |
| 39 int results_base() const { return results_base_; } | 39 int results_base() const { return results_base_; } |
| 40 bool active_tab_is_ntp() const { return active_tab_is_ntp_; } | 40 bool active_tab_is_ntp() const { return active_tab_is_ntp_; } |
| 41 | 41 |
| 42 gfx::Rect GetRect(); | 42 gfx::Rect GetRect(); |
| 43 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults(); | 43 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults(); |
| 44 // Searchbox retains ownership of this object. | 44 // Searchbox retains ownership of this object. |
| 45 const InstantAutocompleteResult* | 45 const InstantAutocompleteResult* |
| 46 GetAutocompleteResultWithId(size_t restricted_id) const; | 46 GetAutocompleteResultWithId(size_t restricted_id) const; |
| 47 const ThemeBackgroundInfo& GetThemeBackgroundInfo(); |
| 48 int GetThemeAreaHeight(); |
| 47 | 49 |
| 48 private: | 50 private: |
| 49 // Overridden from content::RenderViewObserver: | 51 // Overridden from content::RenderViewObserver: |
| 50 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 52 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 51 | 53 |
| 52 void OnChange(const string16& query, | 54 void OnChange(const string16& query, |
| 53 bool verbatim, | 55 bool verbatim, |
| 54 size_t selection_start, | 56 size_t selection_start, |
| 55 size_t selection_end); | 57 size_t selection_end); |
| 56 void OnSubmit(const string16& query); | 58 void OnSubmit(const string16& query); |
| 57 void OnCancel(const string16& query); | 59 void OnCancel(const string16& query); |
| 58 void OnResize(const gfx::Rect& bounds); | 60 void OnResize(const gfx::Rect& bounds); |
| 59 void OnDetermineIfPageSupportsInstant(); | 61 void OnDetermineIfPageSupportsInstant(); |
| 60 void OnAutocompleteResults( | 62 void OnAutocompleteResults( |
| 61 const std::vector<InstantAutocompleteResult>& results); | 63 const std::vector<InstantAutocompleteResult>& results); |
| 62 void OnUpOrDownKeyPressed(int count); | 64 void OnUpOrDownKeyPressed(int count); |
| 63 void OnFocus(); | 65 void OnFocus(); |
| 64 void OnBlur(); | 66 void OnBlur(); |
| 65 void OnActiveTabModeChanged(bool active_tab_is_ntp); | 67 void OnActiveTabModeChanged(bool active_tab_is_ntp); |
| 68 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); |
| 69 void OnThemeAreaHeightChanged(int height); |
| 66 | 70 |
| 67 // Sets the searchbox values to their initial value. | 71 // Sets the searchbox values to their initial value. |
| 68 void Reset(); | 72 void Reset(); |
| 69 | 73 |
| 70 string16 query_; | 74 string16 query_; |
| 71 bool verbatim_; | 75 bool verbatim_; |
| 72 size_t selection_start_; | 76 size_t selection_start_; |
| 73 size_t selection_end_; | 77 size_t selection_end_; |
| 74 size_t results_base_; | 78 size_t results_base_; |
| 75 gfx::Rect rect_; | 79 gfx::Rect rect_; |
| 76 std::vector<InstantAutocompleteResult> autocomplete_results_; | 80 std::vector<InstantAutocompleteResult> autocomplete_results_; |
| 77 size_t last_results_base_; | 81 size_t last_results_base_; |
| 78 std::vector<InstantAutocompleteResult> last_autocomplete_results_; | 82 std::vector<InstantAutocompleteResult> last_autocomplete_results_; |
| 79 bool active_tab_is_ntp_; | 83 bool active_tab_is_ntp_; |
| 84 ThemeBackgroundInfo theme_info_; |
| 85 int theme_area_height_; |
| 80 | 86 |
| 81 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 87 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
| 82 }; | 88 }; |
| 83 | 89 |
| 84 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 90 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
| OLD | NEW |