Chromium Code Reviews| 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 431 is_swapped_out_ = true; | 431 is_swapped_out_ = true; |
| 432 | 432 |
| 433 // Now that we're swapped out and filtering IPC messages, stop loading to | 433 // Now that we're swapped out and filtering IPC messages, stop loading to |
| 434 // ensure that no other in-progress navigation continues. We do this here | 434 // ensure that no other in-progress navigation continues. We do this here |
| 435 // to avoid sending a DidStopLoading message to the browser process. | 435 // to avoid sending a DidStopLoading message to the browser process. |
| 436 // TODO(creis): Should we be stopping all frames here and using | 436 // TODO(creis): Should we be stopping all frames here and using |
| 437 // StopAltErrorPageFetcher with RenderView::OnStop, or just stopping this | 437 // StopAltErrorPageFetcher with RenderView::OnStop, or just stopping this |
| 438 // frame? | 438 // frame? |
| 439 frame_->stopLoading(); | 439 frame_->stopLoading(); |
| 440 | 440 |
| 441 frame_->setIsRemote(true); | |
|
Charlie Reis
2014/02/04 20:11:12
Do we need to set this back to false when swapping
kenrb
2014/02/04 21:45:03
The latter. We don't swap subframes back in yet.
| |
| 442 | |
| 441 // Replace the page with a blank dummy URL. The unload handler will not be | 443 // Replace the page with a blank dummy URL. The unload handler will not be |
| 442 // run a second time, thanks to a check in FrameLoader::stopLoading. | 444 // run a second time, thanks to a check in FrameLoader::stopLoading. |
| 443 // TODO(creis): Need to add a better way to do this that avoids running the | 445 // TODO(creis): Need to add a better way to do this that avoids running the |
| 444 // beforeunload handler. For now, we just run it a second time silently. | 446 // beforeunload handler. For now, we just run it a second time silently. |
| 445 render_view_->NavigateToSwappedOutURL(frame_); | 447 render_view_->NavigateToSwappedOutURL(frame_); |
| 446 | 448 |
| 447 render_view_->RegisterSwappedOutChildFrame(this); | 449 render_view_->RegisterSwappedOutChildFrame(this); |
| 448 } | 450 } |
| 449 | 451 |
| 450 Send(new FrameHostMsg_SwapOut_ACK(routing_id_)); | 452 Send(new FrameHostMsg_SwapOut_ACK(routing_id_)); |
| (...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1622 gfx::Rect start_rect; | 1624 gfx::Rect start_rect; |
| 1623 gfx::Rect end_rect; | 1625 gfx::Rect end_rect; |
| 1624 render_view_->GetSelectionBounds(&start_rect, &end_rect); | 1626 render_view_->GetSelectionBounds(&start_rect, &end_rect); |
| 1625 params.selection_start = gfx::Point(start_rect.x(), start_rect.bottom()); | 1627 params.selection_start = gfx::Point(start_rect.x(), start_rect.bottom()); |
| 1626 params.selection_end = gfx::Point(end_rect.right(), end_rect.bottom()); | 1628 params.selection_end = gfx::Point(end_rect.right(), end_rect.bottom()); |
| 1627 #endif | 1629 #endif |
| 1628 | 1630 |
| 1629 Send(new FrameHostMsg_ContextMenu(routing_id_, params)); | 1631 Send(new FrameHostMsg_ContextMenu(routing_id_, params)); |
| 1630 } | 1632 } |
| 1631 | 1633 |
| 1634 void RenderFrameImpl::initializeChildFrame(const blink::WebRect& frame_rect, | |
|
Charlie Reis
2014/02/04 20:11:12
Just to be sure I follow, you're expecting this to
kenrb
2014/02/04 21:45:03
Yes it is implementing a virtual method from the W
| |
| 1635 float scale_factor) { | |
| 1636 Send(new FrameHostMsg_InitializeChildFrame( | |
| 1637 routing_id_, frame_rect, scale_factor)); | |
| 1638 } | |
| 1639 | |
| 1632 void RenderFrameImpl::AddObserver(RenderFrameObserver* observer) { | 1640 void RenderFrameImpl::AddObserver(RenderFrameObserver* observer) { |
| 1633 observers_.AddObserver(observer); | 1641 observers_.AddObserver(observer); |
| 1634 } | 1642 } |
| 1635 | 1643 |
| 1636 void RenderFrameImpl::RemoveObserver(RenderFrameObserver* observer) { | 1644 void RenderFrameImpl::RemoveObserver(RenderFrameObserver* observer) { |
| 1637 observer->RenderFrameGone(); | 1645 observer->RenderFrameGone(); |
| 1638 observers_.RemoveObserver(observer); | 1646 observers_.RemoveObserver(observer); |
| 1639 } | 1647 } |
| 1640 | 1648 |
| 1641 void RenderFrameImpl::OnStop() { | 1649 void RenderFrameImpl::OnStop() { |
| 1642 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, OnStop()); | 1650 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, OnStop()); |
| 1643 } | 1651 } |
| 1644 | 1652 |
| 1645 } // namespace content | 1653 } // namespace content |
| OLD | NEW |