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 #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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 selection_start_ = 0; | 235 selection_start_ = 0; |
226 selection_end_ = 0; | 236 selection_end_ = 0; |
227 results_base_ = 0; | 237 results_base_ = 0; |
228 rect_ = gfx::Rect(); | 238 rect_ = gfx::Rect(); |
229 autocomplete_results_.clear(); | 239 autocomplete_results_.clear(); |
230 mode_ = chrome::search::Mode(); | 240 mode_ = chrome::search::Mode(); |
231 theme_info_ = ThemeBackgroundInfo(); | 241 theme_info_ = ThemeBackgroundInfo(); |
232 theme_area_height_ = 0; | 242 theme_area_height_ = 0; |
233 display_instant_results_ = false; | 243 display_instant_results_ = false; |
234 } | 244 } |
OLD | NEW |