OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2528 render_view_->Send(new ViewHostMsg_DownloadUrl(render_view_->GetRoutingID(), | 2528 render_view_->Send(new ViewHostMsg_DownloadUrl(render_view_->GetRoutingID(), |
2529 GetRoutingID(), | 2529 GetRoutingID(), |
2530 request.url(), referrer, | 2530 request.url(), referrer, |
2531 suggested_name)); | 2531 suggested_name)); |
2532 } else { | 2532 } else { |
2533 OpenURL(request.url(), referrer, policy, should_replace_current_entry); | 2533 OpenURL(request.url(), referrer, policy, should_replace_current_entry); |
2534 } | 2534 } |
2535 } | 2535 } |
2536 | 2536 |
2537 blink::WebHistoryItem RenderFrameImpl::historyItemForNewChildFrame( | 2537 blink::WebHistoryItem RenderFrameImpl::historyItemForNewChildFrame( |
2538 blink::WebFrame* frame) { | 2538 bool* should_load_request) { |
2539 DCHECK(!frame_ || frame_ == frame); | |
2540 | 2539 |
2541 // TODO(creis): In OOPIF enabled modes, send an IPC to the browser process | 2540 // In OOPIF enabled modes, send an IPC to the browser process telling it to |
2542 // telling it to navigate the new frame. See https://crbug.com/502317. | 2541 // navigate the new frame. |
2543 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) | 2542 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { |
| 2543 std::string unique_name = frame_->uniqueName().utf8(); |
| 2544 // TODO(creis): Have the browser tell the renderer process which names it |
| 2545 // has history items for. In that case, set should_load_request to true and |
| 2546 // return an empty WebHistoryItem so that Blink loads the default. |
| 2547 // See https://crbug.com/502317. |
| 2548 *should_load_request = false; |
| 2549 Send(new FrameHostMsg_NavigateNewChildFrame(routing_id_, unique_name)); |
2544 return WebHistoryItem(); | 2550 return WebHistoryItem(); |
| 2551 } |
2545 | 2552 |
| 2553 *should_load_request = true; |
2546 return render_view_->history_controller()->GetItemForNewChildFrame(this); | 2554 return render_view_->history_controller()->GetItemForNewChildFrame(this); |
2547 } | 2555 } |
2548 | 2556 |
2549 void RenderFrameImpl::willSendSubmitEvent(blink::WebLocalFrame* frame, | 2557 void RenderFrameImpl::willSendSubmitEvent(blink::WebLocalFrame* frame, |
2550 const blink::WebFormElement& form) { | 2558 const blink::WebFormElement& form) { |
2551 DCHECK(!frame_ || frame_ == frame); | 2559 DCHECK(!frame_ || frame_ == frame); |
2552 | 2560 |
2553 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSendSubmitEvent(form)); | 2561 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillSendSubmitEvent(form)); |
2554 } | 2562 } |
2555 | 2563 |
(...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4763 // store the relevant frame's WebHistoryItem in the root of the | 4771 // store the relevant frame's WebHistoryItem in the root of the |
4764 // PageState. | 4772 // PageState. |
4765 SetPendingNavigationParams(navigation_params.Pass()); | 4773 SetPendingNavigationParams(navigation_params.Pass()); |
4766 blink::WebHistoryItem history_item = entry->root(); | 4774 blink::WebHistoryItem history_item = entry->root(); |
4767 blink::WebHistoryLoadType load_type = | 4775 blink::WebHistoryLoadType load_type = |
4768 request_params.is_same_document_history_load | 4776 request_params.is_same_document_history_load |
4769 ? blink::WebHistorySameDocumentLoad | 4777 ? blink::WebHistorySameDocumentLoad |
4770 : blink::WebHistoryDifferentDocumentLoad; | 4778 : blink::WebHistoryDifferentDocumentLoad; |
4771 | 4779 |
4772 // Navigate the frame directly. | 4780 // Navigate the frame directly. |
| 4781 // TODO(creis): Use InitialHistoryLoad rather than BackForward for a |
| 4782 // history navigation in a newly created subframe. |
4773 WebURLRequest request = | 4783 WebURLRequest request = |
4774 frame_->requestFromHistoryItem(history_item, cache_policy); | 4784 frame_->requestFromHistoryItem(history_item, cache_policy); |
4775 frame_->load(request, blink::WebFrameLoadType::BackForward, | 4785 frame_->load(request, blink::WebFrameLoadType::BackForward, |
4776 history_item, load_type); | 4786 history_item, load_type); |
4777 } | 4787 } |
4778 } else { | 4788 } else { |
4779 // TODO(clamy): this should be set to the HistoryItem sent by the | 4789 // TODO(clamy): this should be set to the HistoryItem sent by the |
4780 // browser once the HistoryController has moved to the browser. | 4790 // browser once the HistoryController has moved to the browser. |
4781 // TODO(clamy): distinguish between different document and same document | 4791 // TODO(clamy): distinguish between different document and same document |
4782 // loads. | 4792 // loads. |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5360 media::ConvertToSwitchOutputDeviceCB(web_callbacks); | 5370 media::ConvertToSwitchOutputDeviceCB(web_callbacks); |
5361 scoped_refptr<media::AudioOutputDevice> device = | 5371 scoped_refptr<media::AudioOutputDevice> device = |
5362 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), | 5372 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), |
5363 security_origin); | 5373 security_origin); |
5364 media::OutputDeviceStatus status = device->GetDeviceStatus(); | 5374 media::OutputDeviceStatus status = device->GetDeviceStatus(); |
5365 device->Stop(); | 5375 device->Stop(); |
5366 callback.Run(status); | 5376 callback.Run(status); |
5367 } | 5377 } |
5368 | 5378 |
5369 } // namespace content | 5379 } // namespace content |
OLD | NEW |