| 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 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 #else | 1634 #else |
| 1635 return NULL; | 1635 return NULL; |
| 1636 #endif | 1636 #endif |
| 1637 } | 1637 } |
| 1638 | 1638 |
| 1639 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace() { | 1639 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace() { |
| 1640 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); | 1640 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); |
| 1641 return new WebStorageNamespaceImpl(session_storage_namespace_id_); | 1641 return new WebStorageNamespaceImpl(session_storage_namespace_id_); |
| 1642 } | 1642 } |
| 1643 | 1643 |
| 1644 bool RenderViewImpl::shouldReportDetailedMessageForSource( | |
| 1645 const WebString& source) { | |
| 1646 return GetContentClient()->renderer()->ShouldReportDetailedMessageForSource( | |
| 1647 source); | |
| 1648 } | |
| 1649 | |
| 1650 void RenderViewImpl::didAddMessageToConsole( | |
| 1651 const WebConsoleMessage& message, const WebString& source_name, | |
| 1652 unsigned source_line, const WebString& stack_trace) { | |
| 1653 logging::LogSeverity log_severity = logging::LOG_VERBOSE; | |
| 1654 switch (message.level) { | |
| 1655 case WebConsoleMessage::LevelDebug: | |
| 1656 log_severity = logging::LOG_VERBOSE; | |
| 1657 break; | |
| 1658 case WebConsoleMessage::LevelLog: | |
| 1659 case WebConsoleMessage::LevelInfo: | |
| 1660 log_severity = logging::LOG_INFO; | |
| 1661 break; | |
| 1662 case WebConsoleMessage::LevelWarning: | |
| 1663 log_severity = logging::LOG_WARNING; | |
| 1664 break; | |
| 1665 case WebConsoleMessage::LevelError: | |
| 1666 log_severity = logging::LOG_ERROR; | |
| 1667 break; | |
| 1668 default: | |
| 1669 NOTREACHED(); | |
| 1670 } | |
| 1671 | |
| 1672 if (shouldReportDetailedMessageForSource(source_name)) { | |
| 1673 FOR_EACH_OBSERVER( | |
| 1674 RenderViewObserver, | |
| 1675 observers_, | |
| 1676 DetailedConsoleMessageAdded(message.text, | |
| 1677 source_name, | |
| 1678 stack_trace, | |
| 1679 source_line, | |
| 1680 static_cast<int32>(log_severity))); | |
| 1681 } | |
| 1682 | |
| 1683 Send(new ViewHostMsg_AddMessageToConsole(routing_id_, | |
| 1684 static_cast<int32>(log_severity), | |
| 1685 message.text, | |
| 1686 static_cast<int32>(source_line), | |
| 1687 source_name)); | |
| 1688 } | |
| 1689 | |
| 1690 void RenderViewImpl::printPage(WebFrame* frame) { | 1644 void RenderViewImpl::printPage(WebFrame* frame) { |
| 1691 FOR_EACH_OBSERVER(RenderViewObserver, observers_, | 1645 FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
| 1692 PrintPage(frame, handling_input_event_)); | 1646 PrintPage(frame, handling_input_event_)); |
| 1693 } | 1647 } |
| 1694 | 1648 |
| 1695 blink::WebNotificationPresenter* RenderViewImpl::notificationPresenter() { | 1649 blink::WebNotificationPresenter* RenderViewImpl::notificationPresenter() { |
| 1696 return notification_provider_; | 1650 return notification_provider_; |
| 1697 } | 1651 } |
| 1698 | 1652 |
| 1699 bool RenderViewImpl::enumerateChosenDirectory( | 1653 bool RenderViewImpl::enumerateChosenDirectory( |
| (...skipping 3209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4909 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); | 4863 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); |
| 4910 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4864 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4911 if (!url.isEmpty()) | 4865 if (!url.isEmpty()) |
| 4912 urls.push_back( | 4866 urls.push_back( |
| 4913 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4867 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4914 } | 4868 } |
| 4915 SendUpdateFaviconURL(urls); | 4869 SendUpdateFaviconURL(urls); |
| 4916 } | 4870 } |
| 4917 | 4871 |
| 4918 } // namespace content | 4872 } // namespace content |
| OLD | NEW |