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