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