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 22 matching lines...) Expand all Loading... |
33 #include "base/strings/utf_string_conversions.h" | 33 #include "base/strings/utf_string_conversions.h" |
34 #include "base/time/time.h" | 34 #include "base/time/time.h" |
35 #include "cc/base/switches.h" | 35 #include "cc/base/switches.h" |
36 #include "content/child/appcache/appcache_dispatcher.h" | 36 #include "content/child/appcache/appcache_dispatcher.h" |
37 #include "content/child/appcache/web_application_cache_host_impl.h" | 37 #include "content/child/appcache/web_application_cache_host_impl.h" |
38 #include "content/child/child_shared_bitmap_manager.h" | 38 #include "content/child/child_shared_bitmap_manager.h" |
39 #include "content/child/child_thread.h" | 39 #include "content/child/child_thread.h" |
40 #include "content/child/npapi/webplugin_delegate_impl.h" | 40 #include "content/child/npapi/webplugin_delegate_impl.h" |
41 #include "content/child/request_extra_data.h" | 41 #include "content/child/request_extra_data.h" |
42 #include "content/child/webmessageportchannel_impl.h" | 42 #include "content/child/webmessageportchannel_impl.h" |
| 43 #include "content/common/content_constants_internal.h" |
43 #include "content/common/database_messages.h" | 44 #include "content/common/database_messages.h" |
44 #include "content/common/dom_storage/dom_storage_types.h" | 45 #include "content/common/dom_storage/dom_storage_types.h" |
45 #include "content/common/drag_messages.h" | 46 #include "content/common/drag_messages.h" |
46 #include "content/common/frame_messages.h" | 47 #include "content/common/frame_messages.h" |
47 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 48 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
48 #include "content/common/input_messages.h" | 49 #include "content/common/input_messages.h" |
49 #include "content/common/pepper_messages.h" | 50 #include "content/common/pepper_messages.h" |
50 #include "content/common/socket_stream_handle_data.h" | 51 #include "content/common/socket_stream_handle_data.h" |
51 #include "content/common/ssl_status_serialization.h" | 52 #include "content/common/ssl_status_serialization.h" |
52 #include "content/common/view_messages.h" | 53 #include "content/common/view_messages.h" |
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1714 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace() { | 1715 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace() { |
1715 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); | 1716 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); |
1716 return new WebStorageNamespaceImpl(session_storage_namespace_id_); | 1717 return new WebStorageNamespaceImpl(session_storage_namespace_id_); |
1717 } | 1718 } |
1718 | 1719 |
1719 void RenderViewImpl::printPage(WebLocalFrame* frame) { | 1720 void RenderViewImpl::printPage(WebLocalFrame* frame) { |
1720 FOR_EACH_OBSERVER(RenderViewObserver, observers_, | 1721 FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
1721 PrintPage(frame, handling_input_event_)); | 1722 PrintPage(frame, handling_input_event_)); |
1722 } | 1723 } |
1723 | 1724 |
| 1725 void RenderViewImpl::saveImageFromDataURL(const blink::WebString& data_url) { |
| 1726 // Note: We should basically send GURL but we use size-limited string instead |
| 1727 // in order to send a larger data url to save a image for <canvas> or <img>. |
| 1728 if (data_url.length() < kMaxLengthOfDataURLString) |
| 1729 Send(new ViewHostMsg_SaveImageFromDataURL(routing_id_, data_url.utf8())); |
| 1730 } |
| 1731 |
1724 bool RenderViewImpl::enumerateChosenDirectory( | 1732 bool RenderViewImpl::enumerateChosenDirectory( |
1725 const WebString& path, | 1733 const WebString& path, |
1726 WebFileChooserCompletion* chooser_completion) { | 1734 WebFileChooserCompletion* chooser_completion) { |
1727 int id = enumeration_completion_id_++; | 1735 int id = enumeration_completion_id_++; |
1728 enumeration_completions_[id] = chooser_completion; | 1736 enumeration_completions_[id] = chooser_completion; |
1729 return Send(new ViewHostMsg_EnumerateDirectory( | 1737 return Send(new ViewHostMsg_EnumerateDirectory( |
1730 routing_id_, | 1738 routing_id_, |
1731 id, | 1739 id, |
1732 base::FilePath::FromUTF16Unsafe(path))); | 1740 base::FilePath::FromUTF16Unsafe(path))); |
1733 } | 1741 } |
(...skipping 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4206 std::vector<gfx::Size> sizes; | 4214 std::vector<gfx::Size> sizes; |
4207 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4215 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4208 if (!url.isEmpty()) | 4216 if (!url.isEmpty()) |
4209 urls.push_back( | 4217 urls.push_back( |
4210 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4218 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4211 } | 4219 } |
4212 SendUpdateFaviconURL(urls); | 4220 SendUpdateFaviconURL(urls); |
4213 } | 4221 } |
4214 | 4222 |
4215 } // namespace content | 4223 } // namespace content |
OLD | NEW |