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 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 void SearchBox::ShowInstantPreview(InstantShownReason reason, | 40 void SearchBox::ShowInstantPreview(InstantShownReason reason, |
41 int height, | 41 int height, |
42 InstantSizeUnits units) { | 42 InstantSizeUnits units) { |
43 render_view()->Send(new ChromeViewHostMsg_ShowInstantPreview( | 43 render_view()->Send(new ChromeViewHostMsg_ShowInstantPreview( |
44 render_view()->GetRoutingID(), render_view()->GetPageId(), reason, | 44 render_view()->GetRoutingID(), render_view()->GetPageId(), reason, |
45 height, units)); | 45 height, units)); |
46 } | 46 } |
47 | 47 |
| 48 void SearchBox::StartCapturingKeyStrokes() { |
| 49 render_view()->Send(new ChromeViewHostMsg_StartCapturingKeyStrokes( |
| 50 render_view()->GetRoutingID(), render_view()->GetPageId())); |
| 51 } |
| 52 |
| 53 void SearchBox::StopCapturingKeyStrokes() { |
| 54 render_view()->Send(new ChromeViewHostMsg_StopCapturingKeyStrokes( |
| 55 render_view()->GetRoutingID(), render_view()->GetPageId())); |
| 56 } |
| 57 |
48 gfx::Rect SearchBox::GetRect() { | 58 gfx::Rect SearchBox::GetRect() { |
49 // Need to adjust for scale. | 59 // Need to adjust for scale. |
50 if (rect_.IsEmpty()) | 60 if (rect_.IsEmpty()) |
51 return rect_; | 61 return rect_; |
52 WebKit::WebView* web_view = render_view()->GetWebView(); | 62 WebKit::WebView* web_view = render_view()->GetWebView(); |
53 if (!web_view) | 63 if (!web_view) |
54 return rect_; | 64 return rect_; |
55 double zoom = WebKit::WebView::zoomLevelToZoomFactor(web_view->zoomLevel()); | 65 double zoom = WebKit::WebView::zoomLevelToZoomFactor(web_view->zoomLevel()); |
56 if (zoom == 0) | 66 if (zoom == 0) |
57 return rect_; | 67 return rect_; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 selection_start_ = 0; | 227 selection_start_ = 0; |
218 selection_end_ = 0; | 228 selection_end_ = 0; |
219 results_base_ = 0; | 229 results_base_ = 0; |
220 rect_ = gfx::Rect(); | 230 rect_ = gfx::Rect(); |
221 autocomplete_results_.clear(); | 231 autocomplete_results_.clear(); |
222 mode_ = chrome::search::Mode(); | 232 mode_ = chrome::search::Mode(); |
223 theme_info_ = ThemeBackgroundInfo(); | 233 theme_info_ = ThemeBackgroundInfo(); |
224 theme_area_height_ = 0; | 234 theme_area_height_ = 0; |
225 display_instant_results_ = false; | 235 display_instant_results_ = false; |
226 } | 236 } |
OLD | NEW |