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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 #include "media/audio/audio_output_device.h" | 105 #include "media/audio/audio_output_device.h" |
106 #include "media/base/media_switches.h" | 106 #include "media/base/media_switches.h" |
107 #include "media/renderers/audio_renderer_impl.h" | 107 #include "media/renderers/audio_renderer_impl.h" |
108 #include "media/renderers/gpu_video_accelerator_factories.h" | 108 #include "media/renderers/gpu_video_accelerator_factories.h" |
109 #include "net/base/data_url.h" | 109 #include "net/base/data_url.h" |
110 #include "net/base/escape.h" | 110 #include "net/base/escape.h" |
111 #include "net/base/net_errors.h" | 111 #include "net/base/net_errors.h" |
112 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 112 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
113 #include "net/http/http_util.h" | 113 #include "net/http/http_util.h" |
114 #include "skia/ext/platform_canvas.h" | 114 #include "skia/ext/platform_canvas.h" |
| 115 #include "third_party/WebKit/public/platform/FilePathConversion.h" |
115 #include "third_party/WebKit/public/platform/URLConversion.h" | 116 #include "third_party/WebKit/public/platform/URLConversion.h" |
116 #include "third_party/WebKit/public/platform/WebCString.h" | 117 #include "third_party/WebKit/public/platform/WebCString.h" |
117 #include "third_party/WebKit/public/platform/WebConnectionType.h" | 118 #include "third_party/WebKit/public/platform/WebConnectionType.h" |
118 #include "third_party/WebKit/public/platform/WebDragData.h" | 119 #include "third_party/WebKit/public/platform/WebDragData.h" |
119 #include "third_party/WebKit/public/platform/WebHTTPBody.h" | 120 #include "third_party/WebKit/public/platform/WebHTTPBody.h" |
120 #include "third_party/WebKit/public/platform/WebImage.h" | 121 #include "third_party/WebKit/public/platform/WebImage.h" |
121 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" | 122 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" |
122 #include "third_party/WebKit/public/platform/WebPoint.h" | 123 #include "third_party/WebKit/public/platform/WebPoint.h" |
123 #include "third_party/WebKit/public/platform/WebRect.h" | 124 #include "third_party/WebKit/public/platform/WebRect.h" |
124 #include "third_party/WebKit/public/platform/WebSize.h" | 125 #include "third_party/WebKit/public/platform/WebSize.h" |
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 Send(new ViewHostMsg_SaveImageFromDataURL( | 1733 Send(new ViewHostMsg_SaveImageFromDataURL( |
1733 routing_id(), GetMainRenderFrame()->GetRoutingID(), data_url.utf8())); | 1734 routing_id(), GetMainRenderFrame()->GetRoutingID(), data_url.utf8())); |
1734 } | 1735 } |
1735 | 1736 |
1736 bool RenderViewImpl::enumerateChosenDirectory( | 1737 bool RenderViewImpl::enumerateChosenDirectory( |
1737 const WebString& path, | 1738 const WebString& path, |
1738 WebFileChooserCompletion* chooser_completion) { | 1739 WebFileChooserCompletion* chooser_completion) { |
1739 int id = enumeration_completion_id_++; | 1740 int id = enumeration_completion_id_++; |
1740 enumeration_completions_[id] = chooser_completion; | 1741 enumeration_completions_[id] = chooser_completion; |
1741 return Send(new ViewHostMsg_EnumerateDirectory( | 1742 return Send(new ViewHostMsg_EnumerateDirectory( |
1742 routing_id(), id, base::FilePath::FromUTF16Unsafe(path))); | 1743 routing_id(), id, blink::WebStringToFilePath(path))); |
1743 } | 1744 } |
1744 | 1745 |
1745 void RenderViewImpl::FrameDidStartLoading(WebFrame* frame) { | 1746 void RenderViewImpl::FrameDidStartLoading(WebFrame* frame) { |
1746 DCHECK_GE(frames_in_progress_, 0); | 1747 DCHECK_GE(frames_in_progress_, 0); |
1747 if (frames_in_progress_ == 0) | 1748 if (frames_in_progress_ == 0) |
1748 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidStartLoading()); | 1749 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidStartLoading()); |
1749 frames_in_progress_++; | 1750 frames_in_progress_++; |
1750 } | 1751 } |
1751 | 1752 |
1752 void RenderViewImpl::FrameDidStopLoading(WebFrame* frame) { | 1753 void RenderViewImpl::FrameDidStopLoading(WebFrame* frame) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1812 if (params.directory) | 1813 if (params.directory) |
1813 ipc_params.mode = FileChooserParams::UploadFolder; | 1814 ipc_params.mode = FileChooserParams::UploadFolder; |
1814 else if (params.multiSelect) | 1815 else if (params.multiSelect) |
1815 ipc_params.mode = FileChooserParams::OpenMultiple; | 1816 ipc_params.mode = FileChooserParams::OpenMultiple; |
1816 else if (params.saveAs) | 1817 else if (params.saveAs) |
1817 ipc_params.mode = FileChooserParams::Save; | 1818 ipc_params.mode = FileChooserParams::Save; |
1818 else | 1819 else |
1819 ipc_params.mode = FileChooserParams::Open; | 1820 ipc_params.mode = FileChooserParams::Open; |
1820 ipc_params.title = params.title; | 1821 ipc_params.title = params.title; |
1821 ipc_params.default_file_name = | 1822 ipc_params.default_file_name = |
1822 base::FilePath::FromUTF16Unsafe(params.initialValue).BaseName(); | 1823 blink::WebStringToFilePath(params.initialValue).BaseName(); |
1823 ipc_params.accept_types.reserve(params.acceptTypes.size()); | 1824 ipc_params.accept_types.reserve(params.acceptTypes.size()); |
1824 for (size_t i = 0; i < params.acceptTypes.size(); ++i) | 1825 for (size_t i = 0; i < params.acceptTypes.size(); ++i) |
1825 ipc_params.accept_types.push_back(params.acceptTypes[i]); | 1826 ipc_params.accept_types.push_back(params.acceptTypes[i]); |
1826 ipc_params.need_local_path = params.needLocalPath; | 1827 ipc_params.need_local_path = params.needLocalPath; |
1827 #if defined(OS_ANDROID) | 1828 #if defined(OS_ANDROID) |
1828 ipc_params.capture = params.useMediaCapture; | 1829 ipc_params.capture = params.useMediaCapture; |
1829 #endif | 1830 #endif |
1830 ipc_params.requestor = params.requestor; | 1831 ipc_params.requestor = params.requestor; |
1831 | 1832 |
1832 return ScheduleFileChooser(ipc_params, chooser_completion); | 1833 return ScheduleFileChooser(ipc_params, chooser_completion); |
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3547 if (IsUseZoomForDSFEnabled()) { | 3548 if (IsUseZoomForDSFEnabled()) { |
3548 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3549 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
3549 } else { | 3550 } else { |
3550 webview()->setDeviceScaleFactor(device_scale_factor_); | 3551 webview()->setDeviceScaleFactor(device_scale_factor_); |
3551 } | 3552 } |
3552 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3553 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
3553 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3554 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
3554 } | 3555 } |
3555 | 3556 |
3556 } // namespace content | 3557 } // namespace content |
OLD | NEW |