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 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1708 ipc_params.accept_types.reserve(params.acceptTypes.size()); | 1708 ipc_params.accept_types.reserve(params.acceptTypes.size()); |
1709 for (size_t i = 0; i < params.acceptTypes.size(); ++i) | 1709 for (size_t i = 0; i < params.acceptTypes.size(); ++i) |
1710 ipc_params.accept_types.push_back(params.acceptTypes[i]); | 1710 ipc_params.accept_types.push_back(params.acceptTypes[i]); |
1711 #if defined(OS_ANDROID) | 1711 #if defined(OS_ANDROID) |
1712 ipc_params.capture = params.useMediaCapture; | 1712 ipc_params.capture = params.useMediaCapture; |
1713 #endif | 1713 #endif |
1714 | 1714 |
1715 return ScheduleFileChooser(ipc_params, chooser_completion); | 1715 return ScheduleFileChooser(ipc_params, chooser_completion); |
1716 } | 1716 } |
1717 | 1717 |
1718 void RenderViewImpl::runModalAlertDialog(WebLocalFrame* frame, | |
1719 const WebString& message) { | |
1720 RenderFrameImpl::FromWebFrame(frame)->runModalAlertDialog(message); | |
1721 } | |
1722 | |
1723 bool RenderViewImpl::runModalConfirmDialog(WebLocalFrame* frame, | |
1724 const WebString& message) { | |
1725 return RenderFrameImpl::FromWebFrame(frame)->runModalConfirmDialog(message); | |
1726 } | |
1727 | |
1728 bool RenderViewImpl::runModalPromptDialog(WebLocalFrame* frame, | |
1729 const WebString& message, | |
1730 const WebString& default_value, | |
1731 WebString* actual_value) { | |
1732 return RenderFrameImpl::FromWebFrame(frame)-> | |
1733 runModalPromptDialog(message, default_value, actual_value); | |
1734 } | |
1735 | |
1736 bool RenderViewImpl::runModalBeforeUnloadDialog(WebLocalFrame* frame, | |
1737 const WebString& message) { | |
1738 bool is_reload = false; | |
1739 WebDataSource* ds = frame->provisionalDataSource(); | |
1740 if (ds) | |
1741 is_reload = (ds->navigationType() == blink::WebNavigationTypeReload); | |
1742 return RenderFrameImpl::FromWebFrame(frame)-> | |
1743 runModalBeforeUnloadDialog(is_reload, message); | |
1744 } | |
1745 | |
1746 void RenderViewImpl::runModalAlertDialog(const WebString& message) { | |
1747 /* bogus version of the function to avoid errors */ | |
1748 NOTIMPLEMENTED(); | |
1749 } | |
1750 | |
1751 bool RenderViewImpl::runModalConfirmDialog(const WebString& message) { | |
1752 /* bogus version of the function to avoid errors */ | |
1753 NOTIMPLEMENTED(); | |
1754 return false; | |
1755 } | |
1756 | |
1757 bool RenderViewImpl::runModalPromptDialog(const WebString& message, | |
1758 const WebString& default_value, | |
1759 WebString* actual_value) { | |
1760 /* bogus version of the function to avoid errors */ | |
1761 NOTIMPLEMENTED(); | |
1762 return false; | |
1763 } | |
1764 | |
1765 bool RenderViewImpl::runModalBeforeUnloadDialog(bool is_reload, | |
1766 const WebString& message) { | |
1767 /* bogus version of the function to avoid errors */ | |
1768 NOTIMPLEMENTED(); | |
1769 return false; | |
1770 } | |
1771 | |
1772 void RenderViewImpl::showValidationMessage( | 1718 void RenderViewImpl::showValidationMessage( |
1773 const blink::WebRect& anchor_in_root_view, | 1719 const blink::WebRect& anchor_in_root_view, |
1774 const blink::WebString& main_text, | 1720 const blink::WebString& main_text, |
1775 const blink::WebString& sub_text, | 1721 const blink::WebString& sub_text, |
1776 blink::WebTextDirection hint) { | 1722 blink::WebTextDirection hint) { |
1777 base::string16 wrapped_main_text = main_text; | 1723 base::string16 wrapped_main_text = main_text; |
1778 base::string16 wrapped_sub_text = sub_text; | 1724 base::string16 wrapped_sub_text = sub_text; |
1779 if (hint == blink::WebTextDirectionLeftToRight) { | 1725 if (hint == blink::WebTextDirectionLeftToRight) { |
1780 wrapped_main_text = | 1726 wrapped_main_text = |
1781 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); | 1727 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); |
(...skipping 2811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4593 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); | 4539 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); |
4594 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4540 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4595 if (!url.isEmpty()) | 4541 if (!url.isEmpty()) |
4596 urls.push_back( | 4542 urls.push_back( |
4597 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4543 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4598 } | 4544 } |
4599 SendUpdateFaviconURL(urls); | 4545 SendUpdateFaviconURL(urls); |
4600 } | 4546 } |
4601 | 4547 |
4602 } // namespace content | 4548 } // namespace content |
OLD | NEW |