| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 void SearchBox::StartCapturingKeyStrokes() { | 48 void SearchBox::StartCapturingKeyStrokes() { |
| 49 render_view()->Send(new ChromeViewHostMsg_StartCapturingKeyStrokes( | 49 render_view()->Send(new ChromeViewHostMsg_StartCapturingKeyStrokes( |
| 50 render_view()->GetRoutingID(), render_view()->GetPageId())); | 50 render_view()->GetRoutingID(), render_view()->GetPageId())); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void SearchBox::StopCapturingKeyStrokes() { | 53 void SearchBox::StopCapturingKeyStrokes() { |
| 54 render_view()->Send(new ChromeViewHostMsg_StopCapturingKeyStrokes( | 54 render_view()->Send(new ChromeViewHostMsg_StopCapturingKeyStrokes( |
| 55 render_view()->GetRoutingID(), render_view()->GetPageId())); | 55 render_view()->GetRoutingID(), render_view()->GetPageId())); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void SearchBox::NavigateToURL(const GURL& url) { |
| 59 render_view()->Send(new ChromeViewHostMsg_SearchBoxNavigate( |
| 60 render_view()->GetRoutingID(), render_view()->GetPageId(), |
| 61 url)); |
| 62 } |
| 63 |
| 58 gfx::Rect SearchBox::GetRect() { | 64 gfx::Rect SearchBox::GetRect() { |
| 59 // Need to adjust for scale. | 65 // Need to adjust for scale. |
| 60 if (rect_.IsEmpty()) | 66 if (rect_.IsEmpty()) |
| 61 return rect_; | 67 return rect_; |
| 62 WebKit::WebView* web_view = render_view()->GetWebView(); | 68 WebKit::WebView* web_view = render_view()->GetWebView(); |
| 63 if (!web_view) | 69 if (!web_view) |
| 64 return rect_; | 70 return rect_; |
| 65 double zoom = WebKit::WebView::zoomLevelToZoomFactor(web_view->zoomLevel()); | 71 double zoom = WebKit::WebView::zoomLevelToZoomFactor(web_view->zoomLevel()); |
| 66 if (zoom == 0) | 72 if (zoom == 0) |
| 67 return rect_; | 73 return rect_; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 selection_start_ = 0; | 241 selection_start_ = 0; |
| 236 selection_end_ = 0; | 242 selection_end_ = 0; |
| 237 results_base_ = 0; | 243 results_base_ = 0; |
| 238 rect_ = gfx::Rect(); | 244 rect_ = gfx::Rect(); |
| 239 autocomplete_results_.clear(); | 245 autocomplete_results_.clear(); |
| 240 mode_ = chrome::search::Mode(); | 246 mode_ = chrome::search::Mode(); |
| 241 theme_info_ = ThemeBackgroundInfo(); | 247 theme_info_ = ThemeBackgroundInfo(); |
| 242 theme_area_height_ = 0; | 248 theme_area_height_ = 0; |
| 243 display_instant_results_ = false; | 249 display_instant_results_ = false; |
| 244 } | 250 } |
| OLD | NEW |