OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "base/strings/utf_string_conversions.h" | 30 #include "base/strings/utf_string_conversions.h" |
31 #include "base/time/time.h" | 31 #include "base/time/time.h" |
32 #include "base/trace_event/trace_event.h" | 32 #include "base/trace_event/trace_event.h" |
33 #include "content/child/appcache/appcache_dispatcher.h" | 33 #include "content/child/appcache/appcache_dispatcher.h" |
34 #include "content/child/appcache/web_application_cache_host_impl.h" | 34 #include "content/child/appcache/web_application_cache_host_impl.h" |
35 #include "content/child/child_shared_bitmap_manager.h" | 35 #include "content/child/child_shared_bitmap_manager.h" |
36 #include "content/child/npapi/webplugin_delegate_impl.h" | 36 #include "content/child/npapi/webplugin_delegate_impl.h" |
37 #include "content/child/request_extra_data.h" | 37 #include "content/child/request_extra_data.h" |
38 #include "content/child/v8_value_converter_impl.h" | 38 #include "content/child/v8_value_converter_impl.h" |
39 #include "content/child/webmessageportchannel_impl.h" | 39 #include "content/child/webmessageportchannel_impl.h" |
| 40 #include "content/child/weburlresponse_extradata_impl.h" |
40 #include "content/common/content_constants_internal.h" | 41 #include "content/common/content_constants_internal.h" |
41 #include "content/common/database_messages.h" | 42 #include "content/common/database_messages.h" |
42 #include "content/common/dom_storage/dom_storage_types.h" | 43 #include "content/common/dom_storage/dom_storage_types.h" |
43 #include "content/common/drag_messages.h" | 44 #include "content/common/drag_messages.h" |
44 #include "content/common/frame_messages.h" | 45 #include "content/common/frame_messages.h" |
45 #include "content/common/frame_replication_state.h" | 46 #include "content/common/frame_replication_state.h" |
46 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 47 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
47 #include "content/common/input_messages.h" | 48 #include "content/common/input_messages.h" |
48 #include "content/common/pepper_messages.h" | 49 #include "content/common/pepper_messages.h" |
49 #include "content/common/site_isolation_policy.h" | 50 #include "content/common/site_isolation_policy.h" |
(...skipping 2830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2880 webstring_paths, | 2881 webstring_paths, |
2881 local_directory_name.AsUTF16Unsafe()); | 2882 local_directory_name.AsUTF16Unsafe()); |
2882 } | 2883 } |
2883 | 2884 |
2884 void RenderViewImpl::OnSuppressDialogsUntilSwapOut() { | 2885 void RenderViewImpl::OnSuppressDialogsUntilSwapOut() { |
2885 // Don't show any more dialogs until we finish OnSwapOut. | 2886 // Don't show any more dialogs until we finish OnSwapOut. |
2886 suppress_dialogs_until_swap_out_ = true; | 2887 suppress_dialogs_until_swap_out_ = true; |
2887 } | 2888 } |
2888 | 2889 |
2889 void RenderViewImpl::OnClosePage() { | 2890 void RenderViewImpl::OnClosePage() { |
2890 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ClosePage()); | 2891 WebURLResponseExtraDataImpl* extra_data = |
| 2892 static_cast<WebURLResponseExtraDataImpl*>( |
| 2893 webview()->mainFrame()->dataSource()->response().extraData()); |
| 2894 FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
| 2895 ClosePage(extra_data ? extra_data->is_lofi() : false)); |
2891 // TODO(creis): We'd rather use webview()->Close() here, but that currently | 2896 // TODO(creis): We'd rather use webview()->Close() here, but that currently |
2892 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs | 2897 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs |
2893 // in the onunload handler from appearing. For now, we're bypassing that and | 2898 // in the onunload handler from appearing. For now, we're bypassing that and |
2894 // calling the FrameLoader's CloseURL method directly. This should be | 2899 // calling the FrameLoader's CloseURL method directly. This should be |
2895 // revisited to avoid having two ways to close a page. Having a single way | 2900 // revisited to avoid having two ways to close a page. Having a single way |
2896 // to close that can run onunload is also useful for fixing | 2901 // to close that can run onunload is also useful for fixing |
2897 // http://b/issue?id=753080. | 2902 // http://b/issue?id=753080. |
2898 webview()->mainFrame()->dispatchUnloadEvent(); | 2903 webview()->mainFrame()->dispatchUnloadEvent(); |
2899 | 2904 |
2900 Send(new ViewHostMsg_ClosePage_ACK(routing_id_)); | 2905 Send(new ViewHostMsg_ClosePage_ACK(routing_id_)); |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3799 std::vector<gfx::Size> sizes; | 3804 std::vector<gfx::Size> sizes; |
3800 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3805 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
3801 if (!url.isEmpty()) | 3806 if (!url.isEmpty()) |
3802 urls.push_back( | 3807 urls.push_back( |
3803 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3808 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
3804 } | 3809 } |
3805 SendUpdateFaviconURL(urls); | 3810 SendUpdateFaviconURL(urls); |
3806 } | 3811 } |
3807 | 3812 |
3808 } // namespace content | 3813 } // namespace content |
OLD | NEW |