OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "skia/ext/image_operations.h" | 58 #include "skia/ext/image_operations.h" |
59 #include "webkit/api/public/WebDataSource.h" | 59 #include "webkit/api/public/WebDataSource.h" |
60 #include "webkit/api/public/WebDragData.h" | 60 #include "webkit/api/public/WebDragData.h" |
61 #include "webkit/api/public/WebForm.h" | 61 #include "webkit/api/public/WebForm.h" |
62 #include "webkit/api/public/WebFrame.h" | 62 #include "webkit/api/public/WebFrame.h" |
63 #include "webkit/api/public/WebHistoryItem.h" | 63 #include "webkit/api/public/WebHistoryItem.h" |
64 #include "webkit/api/public/WebNode.h" | 64 #include "webkit/api/public/WebNode.h" |
65 #include "webkit/api/public/WebPoint.h" | 65 #include "webkit/api/public/WebPoint.h" |
66 #include "webkit/api/public/WebRect.h" | 66 #include "webkit/api/public/WebRect.h" |
67 #include "webkit/api/public/WebScriptSource.h" | 67 #include "webkit/api/public/WebScriptSource.h" |
| 68 #include "webkit/api/public/WebSecurityOrigin.h" |
68 #include "webkit/api/public/WebSize.h" | 69 #include "webkit/api/public/WebSize.h" |
69 #include "webkit/api/public/WebURL.h" | 70 #include "webkit/api/public/WebURL.h" |
70 #include "webkit/api/public/WebURLError.h" | 71 #include "webkit/api/public/WebURLError.h" |
71 #include "webkit/api/public/WebURLRequest.h" | 72 #include "webkit/api/public/WebURLRequest.h" |
72 #include "webkit/api/public/WebURLResponse.h" | 73 #include "webkit/api/public/WebURLResponse.h" |
73 #include "webkit/api/public/WebVector.h" | 74 #include "webkit/api/public/WebVector.h" |
74 #include "webkit/appcache/appcache_interfaces.h" | 75 #include "webkit/appcache/appcache_interfaces.h" |
75 #include "webkit/default_plugin/default_plugin_shared.h" | 76 #include "webkit/default_plugin/default_plugin_shared.h" |
76 #include "webkit/glue/glue_serialize.h" | 77 #include "webkit/glue/glue_serialize.h" |
77 #include "webkit/glue/dom_operations.h" | 78 #include "webkit/glue/dom_operations.h" |
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 true, false); | 1319 true, false); |
1319 #endif | 1320 #endif |
1320 RenderView* view = RenderView::Create(render_thread_, | 1321 RenderView* view = RenderView::Create(render_thread_, |
1321 NULL, waitable_event, routing_id_, | 1322 NULL, waitable_event, routing_id_, |
1322 renderer_preferences_, | 1323 renderer_preferences_, |
1323 webkit_preferences_, | 1324 webkit_preferences_, |
1324 shared_popup_counter_, routing_id); | 1325 shared_popup_counter_, routing_id); |
1325 view->opened_by_user_gesture_ = user_gesture; | 1326 view->opened_by_user_gesture_ = user_gesture; |
1326 | 1327 |
1327 // Record the security origin of the creator. | 1328 // Record the security origin of the creator. |
1328 GURL creator_url(creator->securityOrigin().utf8()); | 1329 GURL creator_url(creator->securityOrigin().toString().utf8()); |
1329 if (!creator_url.is_valid() || !creator_url.IsStandard()) | 1330 if (!creator_url.is_valid() || !creator_url.IsStandard()) |
1330 creator_url = GURL(); | 1331 creator_url = GURL(); |
1331 view->creator_url_ = creator_url; | 1332 view->creator_url_ = creator_url; |
1332 | 1333 |
1333 // Copy over the alternate error page URL so we can have alt error pages in | 1334 // Copy over the alternate error page URL so we can have alt error pages in |
1334 // the new render view (we don't need the browser to send the URL back down). | 1335 // the new render view (we don't need the browser to send the URL back down). |
1335 view->alternate_error_page_url_ = alternate_error_page_url_; | 1336 view->alternate_error_page_url_ = alternate_error_page_url_; |
1336 | 1337 |
1337 return view->webview(); | 1338 return view->webview(); |
1338 } | 1339 } |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 } | 2224 } |
2224 | 2225 |
2225 void RenderView::didLoadResourceFromMemoryCache( | 2226 void RenderView::didLoadResourceFromMemoryCache( |
2226 WebFrame* frame, const WebURLRequest& request, | 2227 WebFrame* frame, const WebURLRequest& request, |
2227 const WebURLResponse& response) { | 2228 const WebURLResponse& response) { |
2228 // Let the browser know we loaded a resource from the memory cache. This | 2229 // Let the browser know we loaded a resource from the memory cache. This |
2229 // message is needed to display the correct SSL indicators. | 2230 // message is needed to display the correct SSL indicators. |
2230 Send(new ViewHostMsg_DidLoadResourceFromMemoryCache( | 2231 Send(new ViewHostMsg_DidLoadResourceFromMemoryCache( |
2231 routing_id_, | 2232 routing_id_, |
2232 request.url(), | 2233 request.url(), |
2233 frame->securityOrigin().utf8(), | 2234 frame->securityOrigin().toString().utf8(), |
2234 frame->top()->securityOrigin().utf8(), | 2235 frame->top()->securityOrigin().toString().utf8(), |
2235 response.securityInfo())); | 2236 response.securityInfo())); |
2236 } | 2237 } |
2237 | 2238 |
2238 void RenderView::didExhaustMemoryAvailableForScript(WebFrame* frame) { | 2239 void RenderView::didExhaustMemoryAvailableForScript(WebFrame* frame) { |
2239 Send(new ViewHostMsg_JSOutOfMemory(routing_id_)); | 2240 Send(new ViewHostMsg_JSOutOfMemory(routing_id_)); |
2240 } | 2241 } |
2241 | 2242 |
2242 void RenderView::didChangeContentsSize(WebFrame* frame, const WebSize& size) { | 2243 void RenderView::didChangeContentsSize(WebFrame* frame, const WebSize& size) { |
2243 // We don't always want to send the change messages over IPC, only if we've | 2244 // We don't always want to send the change messages over IPC, only if we've |
2244 // be put in that mode by getting a |ViewMsg_EnableIntrinsicWidthChangedMode| | 2245 // be put in that mode by getting a |ViewMsg_EnableIntrinsicWidthChangedMode| |
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3508 // TODO(darin): There's actually no reason for this to be here. We should | 3509 // TODO(darin): There's actually no reason for this to be here. We should |
3509 // have the browser side manage the document tag. | 3510 // have the browser side manage the document tag. |
3510 #if defined(OS_MACOSX) | 3511 #if defined(OS_MACOSX) |
3511 if (!has_document_tag_) { | 3512 if (!has_document_tag_) { |
3512 // Make the call to get the tag. | 3513 // Make the call to get the tag. |
3513 Send(new ViewHostMsg_GetDocumentTag(routing_id_, &document_tag_)); | 3514 Send(new ViewHostMsg_GetDocumentTag(routing_id_, &document_tag_)); |
3514 has_document_tag_ = true; | 3515 has_document_tag_ = true; |
3515 } | 3516 } |
3516 #endif | 3517 #endif |
3517 } | 3518 } |
OLD | NEW |