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