| 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 #include "chrome/renderer/searchbox/searchbox.h" | 5 #include "chrome/renderer/searchbox/searchbox.h" |
| 6 | 6 |
| 7 #include "chrome/common/render_messages.h" | 7 #include "chrome/common/render_messages.h" |
| 8 #include "chrome/renderer/searchbox/searchbox_extension.h" | 8 #include "chrome/renderer/searchbox/searchbox_extension.h" |
| 9 #include "content/public/renderer/render_view.h" | 9 #include "content/public/renderer/render_view.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 suggestions[0].behavior == INSTANT_COMPLETE_REPLACE) { | 29 suggestions[0].behavior == INSTANT_COMPLETE_REPLACE) { |
| 30 query_ = suggestions[0].text; | 30 query_ = suggestions[0].text; |
| 31 verbatim_ = true; | 31 verbatim_ = true; |
| 32 selection_start_ = selection_end_ = query_.size(); | 32 selection_start_ = selection_end_ = query_.size(); |
| 33 } | 33 } |
| 34 // Explicitly allow empty vector to be sent to the browser. | 34 // Explicitly allow empty vector to be sent to the browser. |
| 35 render_view()->Send(new ChromeViewHostMsg_SetSuggestions( | 35 render_view()->Send(new ChromeViewHostMsg_SetSuggestions( |
| 36 render_view()->GetRoutingID(), render_view()->GetPageId(), suggestions)); | 36 render_view()->GetRoutingID(), render_view()->GetPageId(), suggestions)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void SearchBox::OnWebSearchBoxFocusChange(bool is_focused) { |
| 40 render_view()->Send(new ChromeViewHostMsg_OnWebSearchBoxFocusChange( |
| 41 render_view()->GetRoutingID(), render_view()->GetPageId(), is_focused)); |
| 42 } |
| 43 |
| 39 void SearchBox::ShowInstantPreview(InstantShownReason reason, | 44 void SearchBox::ShowInstantPreview(InstantShownReason reason, |
| 40 int height, | 45 int height, |
| 41 InstantSizeUnits units) { | 46 InstantSizeUnits units) { |
| 42 render_view()->Send(new ChromeViewHostMsg_ShowInstantPreview( | 47 render_view()->Send(new ChromeViewHostMsg_ShowInstantPreview( |
| 43 render_view()->GetRoutingID(), render_view()->GetPageId(), reason, | 48 render_view()->GetRoutingID(), render_view()->GetPageId(), reason, |
| 44 height, units)); | 49 height, units)); |
| 45 } | 50 } |
| 46 | 51 |
| 47 gfx::Rect SearchBox::GetRect() { | 52 gfx::Rect SearchBox::GetRect() { |
| 48 // Need to adjust for scale. | 53 // Need to adjust for scale. |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 void SearchBox::Reset() { | 184 void SearchBox::Reset() { |
| 180 query_.clear(); | 185 query_.clear(); |
| 181 verbatim_ = false; | 186 verbatim_ = false; |
| 182 selection_start_ = 0; | 187 selection_start_ = 0; |
| 183 selection_end_ = 0; | 188 selection_end_ = 0; |
| 184 results_base_ = 0; | 189 results_base_ = 0; |
| 185 rect_ = gfx::Rect(); | 190 rect_ = gfx::Rect(); |
| 186 autocomplete_results_.clear(); | 191 autocomplete_results_.clear(); |
| 187 active_tab_is_ntp_ = false; | 192 active_tab_is_ntp_ = false; |
| 188 } | 193 } |
| OLD | NEW |