OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1937 return NULL; | 1937 return NULL; |
1938 #endif | 1938 #endif |
1939 } | 1939 } |
1940 | 1940 |
1941 void RenderView::OpenURL(WebView* webview, const GURL& url, | 1941 void RenderView::OpenURL(WebView* webview, const GURL& url, |
1942 const GURL& referrer, | 1942 const GURL& referrer, |
1943 WindowOpenDisposition disposition) { | 1943 WindowOpenDisposition disposition) { |
1944 Send(new ViewHostMsg_OpenURL(routing_id_, url, referrer, disposition)); | 1944 Send(new ViewHostMsg_OpenURL(routing_id_, url, referrer, disposition)); |
1945 } | 1945 } |
1946 | 1946 |
| 1947 void RenderView::DidContentsSizeChange(WebWidget* webwidget, |
| 1948 int new_width, |
| 1949 int new_height) { |
| 1950 // TODO(rafaelw): This is a temporary solution. Only the ExtensionView wants |
| 1951 // this notification at the moment. It isn't clean to test for ExtensionView |
| 1952 // by examining the enabled_bindings. This needs to be generalized as it |
| 1953 // becomes clear what extension toolbars need. |
| 1954 if (BindingsPolicy::is_extension_enabled(enabled_bindings_)) { |
| 1955 int width = webview()->GetMainFrame()->GetContentsPreferredWidth(); |
| 1956 Send(new ViewHostMsg_DidContentsPreferredWidthChange(routing_id_, width)); |
| 1957 } |
| 1958 } |
| 1959 |
1947 // We are supposed to get a single call to Show for a newly created RenderView | 1960 // We are supposed to get a single call to Show for a newly created RenderView |
1948 // that was created via RenderView::CreateWebView. So, we wait until this | 1961 // that was created via RenderView::CreateWebView. So, we wait until this |
1949 // point to dispatch the ShowView message. | 1962 // point to dispatch the ShowView message. |
1950 // | 1963 // |
1951 // This method provides us with the information about how to display the newly | 1964 // This method provides us with the information about how to display the newly |
1952 // created RenderView (i.e., as a constrained popup or as a new tab). | 1965 // created RenderView (i.e., as a constrained popup or as a new tab). |
1953 // | 1966 // |
1954 void RenderView::Show(WebWidget* webwidget, WindowOpenDisposition disposition) { | 1967 void RenderView::Show(WebWidget* webwidget, WindowOpenDisposition disposition) { |
1955 DCHECK(!did_show_) << "received extraneous Show call"; | 1968 DCHECK(!did_show_) << "received extraneous Show call"; |
1956 DCHECK(opener_id_ != MSG_ROUTING_NONE); | 1969 DCHECK(opener_id_ != MSG_ROUTING_NONE); |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3114 "Renderer.Other.StartToFinishDoc", start_to_finish_doc); | 3127 "Renderer.Other.StartToFinishDoc", start_to_finish_doc); |
3115 UMA_HISTOGRAM_TIMES( | 3128 UMA_HISTOGRAM_TIMES( |
3116 "Renderer.Other.FinishDocToFinish", finish_doc_to_finish); | 3129 "Renderer.Other.FinishDocToFinish", finish_doc_to_finish); |
3117 UMA_HISTOGRAM_TIMES( | 3130 UMA_HISTOGRAM_TIMES( |
3118 "Renderer.Other.RequestToFinish", request_to_finish); | 3131 "Renderer.Other.RequestToFinish", request_to_finish); |
3119 UMA_HISTOGRAM_TIMES( | 3132 UMA_HISTOGRAM_TIMES( |
3120 "Renderer.Other.StartToFinish", start_to_finish); | 3133 "Renderer.Other.StartToFinish", start_to_finish); |
3121 break; | 3134 break; |
3122 } | 3135 } |
3123 } | 3136 } |
OLD | NEW |