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