| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/renderer/render_view.h" | 5 #include "content/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "content/common/content_constants.h" | 28 #include "content/common/content_constants.h" |
| 29 #include "content/common/content_switches.h" | 29 #include "content/common/content_switches.h" |
| 30 #include "content/common/database_messages.h" | 30 #include "content/common/database_messages.h" |
| 31 #include "content/common/drag_messages.h" | 31 #include "content/common/drag_messages.h" |
| 32 #include "content/common/file_system/file_system_dispatcher.h" | 32 #include "content/common/file_system/file_system_dispatcher.h" |
| 33 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" | 33 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" |
| 34 #include "content/common/json_value_serializer.h" | 34 #include "content/common/json_value_serializer.h" |
| 35 #include "content/common/notification_service.h" | 35 #include "content/common/notification_service.h" |
| 36 #include "content/common/pepper_messages.h" | 36 #include "content/common/pepper_messages.h" |
| 37 #include "content/common/pepper_plugin_registry.h" | 37 #include "content/common/pepper_plugin_registry.h" |
| 38 #include "content/common/resource_dispatcher.h" |
| 38 #include "content/common/quota_dispatcher.h" | 39 #include "content/common/quota_dispatcher.h" |
| 39 #include "content/common/renderer_preferences.h" | 40 #include "content/common/renderer_preferences.h" |
| 40 #include "content/common/url_constants.h" | 41 #include "content/common/url_constants.h" |
| 41 #include "content/common/view_messages.h" | 42 #include "content/common/view_messages.h" |
| 42 #include "content/renderer/content_renderer_client.h" | 43 #include "content/renderer/content_renderer_client.h" |
| 43 #include "content/renderer/devtools_agent.h" | 44 #include "content/renderer/devtools_agent.h" |
| 44 #include "content/renderer/device_orientation_dispatcher.h" | 45 #include "content/renderer/device_orientation_dispatcher.h" |
| 45 #include "content/renderer/mhtml_generator.h" | 46 #include "content/renderer/mhtml_generator.h" |
| 46 #include "content/renderer/external_popup_menu.h" | 47 #include "content/renderer/external_popup_menu.h" |
| 47 #include "content/renderer/geolocation_dispatcher.h" | 48 #include "content/renderer/geolocation_dispatcher.h" |
| (...skipping 2560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2608 didCommitProvisionalLoad(frame, is_new_navigation); | 2609 didCommitProvisionalLoad(frame, is_new_navigation); |
| 2609 | 2610 |
| 2610 WebDataSource* datasource = frame->view()->mainFrame()->dataSource(); | 2611 WebDataSource* datasource = frame->view()->mainFrame()->dataSource(); |
| 2611 UpdateTitle(frame, datasource->pageTitle(), datasource->pageTitleDirection()); | 2612 UpdateTitle(frame, datasource->pageTitle(), datasource->pageTitleDirection()); |
| 2612 } | 2613 } |
| 2613 | 2614 |
| 2614 void RenderView::didUpdateCurrentHistoryItem(WebFrame* frame) { | 2615 void RenderView::didUpdateCurrentHistoryItem(WebFrame* frame) { |
| 2615 StartNavStateSyncTimerIfNecessary(); | 2616 StartNavStateSyncTimerIfNecessary(); |
| 2616 } | 2617 } |
| 2617 | 2618 |
| 2619 // Called by WebKit on new or transferred requests to introduce the request |
| 2620 // to the RenderView. If this RenderView inherited a pending Request from other |
| 2621 // RenderView (as in the case of reparenting an iframe via adoptNode() JS API), |
| 2622 // we need to update routing information to point to this RenderView. |
| 2618 void RenderView::assignIdentifierToRequest( | 2623 void RenderView::assignIdentifierToRequest( |
| 2619 WebFrame* frame, unsigned identifier, const WebURLRequest& request) { | 2624 WebFrame* frame, unsigned identifier, const WebURLRequest& request) { |
| 2620 // Ignore | 2625 if (RenderThread::current()) // Will be NULL during tests. |
| 2626 RenderThread::current()->resource_dispatcher()->TransferRequestToNewPage( |
| 2627 identifier, routing_id_); |
| 2621 } | 2628 } |
| 2622 | 2629 |
| 2623 void RenderView::willSendRequest( | 2630 void RenderView::willSendRequest( |
| 2624 WebFrame* frame, unsigned identifier, WebURLRequest& request, | 2631 WebFrame* frame, unsigned identifier, WebURLRequest& request, |
| 2625 const WebURLResponse& redirect_response) { | 2632 const WebURLResponse& redirect_response) { |
| 2626 WebFrame* top_frame = frame->top(); | 2633 WebFrame* top_frame = frame->top(); |
| 2627 if (!top_frame) | 2634 if (!top_frame) |
| 2628 top_frame = frame; | 2635 top_frame = frame; |
| 2629 WebDataSource* provisional_data_source = top_frame->provisionalDataSource(); | 2636 WebDataSource* provisional_data_source = top_frame->provisionalDataSource(); |
| 2630 WebDataSource* top_data_source = top_frame->dataSource(); | 2637 WebDataSource* top_data_source = top_frame->dataSource(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2650 | 2657 |
| 2651 if (top_data_source) { | 2658 if (top_data_source) { |
| 2652 NavigationState* state = NavigationState::FromDataSource(top_data_source); | 2659 NavigationState* state = NavigationState::FromDataSource(top_data_source); |
| 2653 // TODO(gavinp): separate out prefetching and prerender field trials | 2660 // TODO(gavinp): separate out prefetching and prerender field trials |
| 2654 // if the rel=prerender rel type is sticking around. | 2661 // if the rel=prerender rel type is sticking around. |
| 2655 if (state && (request.targetType() == WebURLRequest::TargetIsPrefetch || | 2662 if (state && (request.targetType() == WebURLRequest::TargetIsPrefetch || |
| 2656 request.targetType() == WebURLRequest::TargetIsPrerender)) | 2663 request.targetType() == WebURLRequest::TargetIsPrerender)) |
| 2657 state->set_was_prefetcher(true); | 2664 state->set_was_prefetcher(true); |
| 2658 } | 2665 } |
| 2659 | 2666 |
| 2667 request.setIdentifier(identifier); |
| 2668 |
| 2660 request.setRequestorID(routing_id_); | 2669 request.setRequestorID(routing_id_); |
| 2661 request.setHasUserGesture(frame->isProcessingUserGesture()); | 2670 request.setHasUserGesture(frame->isProcessingUserGesture()); |
| 2662 | 2671 |
| 2663 if (!renderer_preferences_.enable_referrers) | 2672 if (!renderer_preferences_.enable_referrers) |
| 2664 request.clearHTTPHeaderField("Referer"); | 2673 request.clearHTTPHeaderField("Referer"); |
| 2665 } | 2674 } |
| 2666 | 2675 |
| 2667 void RenderView::didReceiveResponse( | 2676 void RenderView::didReceiveResponse( |
| 2668 WebFrame* frame, unsigned identifier, const WebURLResponse& response) { | 2677 WebFrame* frame, unsigned identifier, const WebURLResponse& response) { |
| 2669 | 2678 |
| (...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4433 } | 4442 } |
| 4434 #endif | 4443 #endif |
| 4435 | 4444 |
| 4436 void RenderView::OnContextMenuClosed( | 4445 void RenderView::OnContextMenuClosed( |
| 4437 const webkit_glue::CustomContextMenuContext& custom_context) { | 4446 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 4438 if (custom_context.is_pepper_menu) | 4447 if (custom_context.is_pepper_menu) |
| 4439 pepper_delegate_.OnContextMenuClosed(custom_context); | 4448 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 4440 else | 4449 else |
| 4441 context_menu_node_.reset(); | 4450 context_menu_node_.reset(); |
| 4442 } | 4451 } |
| OLD | NEW |