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 2865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2915 webstring_paths, | 2916 webstring_paths, |
2916 local_directory_name.AsUTF16Unsafe()); | 2917 local_directory_name.AsUTF16Unsafe()); |
2917 } | 2918 } |
2918 | 2919 |
2919 void RenderViewImpl::OnSuppressDialogsUntilSwapOut() { | 2920 void RenderViewImpl::OnSuppressDialogsUntilSwapOut() { |
2920 // Don't show any more dialogs until we finish OnSwapOut. | 2921 // Don't show any more dialogs until we finish OnSwapOut. |
2921 suppress_dialogs_until_swap_out_ = true; | 2922 suppress_dialogs_until_swap_out_ = true; |
2922 } | 2923 } |
2923 | 2924 |
2924 void RenderViewImpl::OnClosePage() { | 2925 void RenderViewImpl::OnClosePage() { |
2925 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ClosePage()); | 2926 WebURLResponseExtraDataImpl* extra_data = |
| 2927 static_cast<WebURLResponseExtraDataImpl*>( |
| 2928 webview()->mainFrame()->dataSource()->response().extraData()); |
| 2929 FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
| 2930 ClosePage(extra_data ? extra_data->is_lofi() : false)); |
2926 // TODO(creis): We'd rather use webview()->Close() here, but that currently | 2931 // TODO(creis): We'd rather use webview()->Close() here, but that currently |
2927 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs | 2932 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs |
2928 // in the onunload handler from appearing. For now, we're bypassing that and | 2933 // in the onunload handler from appearing. For now, we're bypassing that and |
2929 // calling the FrameLoader's CloseURL method directly. This should be | 2934 // calling the FrameLoader's CloseURL method directly. This should be |
2930 // revisited to avoid having two ways to close a page. Having a single way | 2935 // revisited to avoid having two ways to close a page. Having a single way |
2931 // to close that can run onunload is also useful for fixing | 2936 // to close that can run onunload is also useful for fixing |
2932 // http://b/issue?id=753080. | 2937 // http://b/issue?id=753080. |
2933 webview()->mainFrame()->dispatchUnloadEvent(); | 2938 webview()->mainFrame()->dispatchUnloadEvent(); |
2934 | 2939 |
2935 Send(new ViewHostMsg_ClosePage_ACK(routing_id_)); | 2940 Send(new ViewHostMsg_ClosePage_ACK(routing_id_)); |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3834 std::vector<gfx::Size> sizes; | 3839 std::vector<gfx::Size> sizes; |
3835 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3840 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
3836 if (!url.isEmpty()) | 3841 if (!url.isEmpty()) |
3837 urls.push_back( | 3842 urls.push_back( |
3838 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3843 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
3839 } | 3844 } |
3840 SendUpdateFaviconURL(urls); | 3845 SendUpdateFaviconURL(urls); |
3841 } | 3846 } |
3842 | 3847 |
3843 } // namespace content | 3848 } // namespace content |
OLD | NEW |