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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 results_base_ = 0; | 247 results_base_ = 0; |
242 rect_ = gfx::Rect(); | 248 rect_ = gfx::Rect(); |
243 autocomplete_results_.clear(); | 249 autocomplete_results_.clear(); |
244 mode_ = chrome::search::Mode(); | 250 mode_ = chrome::search::Mode(); |
245 theme_info_ = ThemeBackgroundInfo(); | 251 theme_info_ = ThemeBackgroundInfo(); |
246 theme_area_height_ = 0; | 252 theme_area_height_ = 0; |
247 // Don't reset display_instant_results_ to prevent clearing it on committed | 253 // Don't reset display_instant_results_ to prevent clearing it on committed |
248 // results pages in extended mode. Otherwise resetting it is a no-op because | 254 // results pages in extended mode. Otherwise resetting it is a no-op because |
249 // a new loader is created when it changes; see crbug.com/164662. | 255 // a new loader is created when it changes; see crbug.com/164662. |
250 } | 256 } |
OLD | NEW |