| 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" |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "chrome/common/instant_types.h" | 12 #include "chrome/common/instant_types.h" |
| 13 #include "content/public/renderer/render_view_observer.h" | 13 #include "content/public/renderer/render_view_observer.h" |
| 14 #include "content/public/renderer/render_view_observer_tracker.h" | 14 #include "content/public/renderer/render_view_observer_tracker.h" |
| 15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class RenderView; | 18 class RenderView; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class SearchBox : public content::RenderViewObserver, | 21 class SearchBox : public content::RenderViewObserver, |
| 22 public content::RenderViewObserverTracker<SearchBox> { | 22 public content::RenderViewObserverTracker<SearchBox> { |
| 23 public: | 23 public: |
| 24 explicit SearchBox(content::RenderView* render_view); | 24 explicit SearchBox(content::RenderView* render_view); |
| 25 virtual ~SearchBox(); | 25 virtual ~SearchBox(); |
| 26 | 26 |
| 27 // Sends ViewHostMsg_SetSuggestions to the browser. | 27 // Sends ViewHostMsg_SetSuggestions to the browser. |
| 28 void SetSuggestions(const std::vector<InstantSuggestion>& suggestions); | 28 void SetSuggestions(const std::vector<InstantSuggestion>& suggestions); |
| 29 | 29 |
| 30 // Sends ViewHostMsg_OnWebSearchBoxFocusChange to the browser. |
| 31 void OnWebSearchBoxFocusChange(bool is_focused); |
| 32 |
| 30 // Sends ViewHostMsg_ShowInstantPreview to the browser. | 33 // Sends ViewHostMsg_ShowInstantPreview to the browser. |
| 31 void ShowInstantPreview(InstantShownReason reason, | 34 void ShowInstantPreview(InstantShownReason reason, |
| 32 int height, | 35 int height, |
| 33 InstantSizeUnits units); | 36 InstantSizeUnits units); |
| 34 | 37 |
| 35 const string16& query() const { return query_; } | 38 const string16& query() const { return query_; } |
| 36 bool verbatim() const { return verbatim_; } | 39 bool verbatim() const { return verbatim_; } |
| 37 size_t selection_start() const { return selection_start_; } | 40 size_t selection_start() const { return selection_start_; } |
| 38 size_t selection_end() const { return selection_end_; } | 41 size_t selection_end() const { return selection_end_; } |
| 39 int results_base() const { return results_base_; } | 42 int results_base() const { return results_base_; } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 gfx::Rect rect_; | 78 gfx::Rect rect_; |
| 76 std::vector<InstantAutocompleteResult> autocomplete_results_; | 79 std::vector<InstantAutocompleteResult> autocomplete_results_; |
| 77 size_t last_results_base_; | 80 size_t last_results_base_; |
| 78 std::vector<InstantAutocompleteResult> last_autocomplete_results_; | 81 std::vector<InstantAutocompleteResult> last_autocomplete_results_; |
| 79 bool active_tab_is_ntp_; | 82 bool active_tab_is_ntp_; |
| 80 | 83 |
| 81 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 84 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 87 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
| OLD | NEW |