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_impl.h" | 5 #include "content/renderer/render_view_impl.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 3812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3823 webview()->mainFrame()->loadHTMLString(std::string(), | 3823 webview()->mainFrame()->loadHTMLString(std::string(), |
3824 GURL("about:swappedout"), | 3824 GURL("about:swappedout"), |
3825 GURL("about:swappedout"), | 3825 GURL("about:swappedout"), |
3826 false); | 3826 false); |
3827 | 3827 |
3828 // Just echo back the params in the ACK. | 3828 // Just echo back the params in the ACK. |
3829 Send(new ViewHostMsg_SwapOut_ACK(routing_id_, params)); | 3829 Send(new ViewHostMsg_SwapOut_ACK(routing_id_, params)); |
3830 } | 3830 } |
3831 | 3831 |
3832 void RenderViewImpl::OnClosePage() { | 3832 void RenderViewImpl::OnClosePage() { |
| 3833 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ClosePage()); |
3833 // TODO(creis): We'd rather use webview()->Close() here, but that currently | 3834 // TODO(creis): We'd rather use webview()->Close() here, but that currently |
3834 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs | 3835 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs |
3835 // in the onunload handler from appearing. For now, we're bypassing that and | 3836 // in the onunload handler from appearing. For now, we're bypassing that and |
3836 // calling the FrameLoader's CloseURL method directly. This should be | 3837 // calling the FrameLoader's CloseURL method directly. This should be |
3837 // revisited to avoid having two ways to close a page. Having a single way | 3838 // revisited to avoid having two ways to close a page. Having a single way |
3838 // to close that can run onunload is also useful for fixing | 3839 // to close that can run onunload is also useful for fixing |
3839 // http://b/issue?id=753080. | 3840 // http://b/issue?id=753080. |
3840 webview()->dispatchUnloadEvent(); | 3841 webview()->dispatchUnloadEvent(); |
3841 | 3842 |
3842 Send(new ViewHostMsg_ClosePage_ACK(routing_id_)); | 3843 Send(new ViewHostMsg_ClosePage_ACK(routing_id_)); |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4593 pepper_delegate_.OnLockMouseACK(succeeded); | 4594 pepper_delegate_.OnLockMouseACK(succeeded); |
4594 } | 4595 } |
4595 | 4596 |
4596 void RenderViewImpl::OnMouseLockLost() { | 4597 void RenderViewImpl::OnMouseLockLost() { |
4597 pepper_delegate_.OnMouseLockLost(); | 4598 pepper_delegate_.OnMouseLockLost(); |
4598 } | 4599 } |
4599 | 4600 |
4600 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4601 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4601 return webview()->settings()->useThreadedCompositor(); | 4602 return webview()->settings()->useThreadedCompositor(); |
4602 } | 4603 } |
OLD | NEW |