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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 DidDetachInterstitialPage()); | 1756 DidDetachInterstitialPage()); |
1757 } | 1757 } |
1758 | 1758 |
1759 bool WebContentsImpl::NavigateToEntry( | 1759 bool WebContentsImpl::NavigateToEntry( |
1760 const NavigationEntryImpl& entry, | 1760 const NavigationEntryImpl& entry, |
1761 NavigationController::ReloadType reload_type) { | 1761 NavigationController::ReloadType reload_type) { |
1762 TRACE_EVENT0("browser", "WebContentsImpl::NavigateToEntry"); | 1762 TRACE_EVENT0("browser", "WebContentsImpl::NavigateToEntry"); |
1763 | 1763 |
1764 // The renderer will reject IPC messages with URLs longer than | 1764 // The renderer will reject IPC messages with URLs longer than |
1765 // this limit, so don't attempt to navigate with a longer URL. | 1765 // this limit, so don't attempt to navigate with a longer URL. |
1766 if (entry.GetURL().spec().size() > kMaxURLChars) | 1766 if (entry.GetURL().spec().size() > kMaxURLChars) { |
| 1767 LOG(WARNING) << "Refusing to load URL as it exceeds " << kMaxURLChars |
| 1768 << " characters."; |
1767 return false; | 1769 return false; |
| 1770 } |
1768 | 1771 |
1769 RenderViewHostImpl* dest_render_view_host = | 1772 RenderViewHostImpl* dest_render_view_host = |
1770 static_cast<RenderViewHostImpl*>(render_manager_.Navigate(entry)); | 1773 static_cast<RenderViewHostImpl*>(render_manager_.Navigate(entry)); |
1771 if (!dest_render_view_host) | 1774 if (!dest_render_view_host) |
1772 return false; // Unable to create the desired render view host. | 1775 return false; // Unable to create the desired render view host. |
1773 | 1776 |
1774 // For security, we should never send non-Web-UI URLs to a Web UI renderer. | 1777 // For security, we should never send non-Web-UI URLs to a Web UI renderer. |
1775 // Double check that here. | 1778 // Double check that here. |
1776 int enabled_bindings = dest_render_view_host->GetEnabledBindings(); | 1779 int enabled_bindings = dest_render_view_host->GetEnabledBindings(); |
1777 bool data_urls_allowed = delegate_ && delegate_->CanLoadDataURLsInWebUI(); | 1780 bool data_urls_allowed = delegate_ && delegate_->CanLoadDataURLsInWebUI(); |
(...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3790 gfx::Size WebContentsImpl::GetSizeForNewRenderView() const { | 3793 gfx::Size WebContentsImpl::GetSizeForNewRenderView() const { |
3791 gfx::Size size; | 3794 gfx::Size size; |
3792 if (delegate_) | 3795 if (delegate_) |
3793 size = delegate_->GetSizeForNewRenderView(this); | 3796 size = delegate_->GetSizeForNewRenderView(this); |
3794 if (size.IsEmpty()) | 3797 if (size.IsEmpty()) |
3795 size = view_->GetContainerSize(); | 3798 size = view_->GetContainerSize(); |
3796 return size; | 3799 return size; |
3797 } | 3800 } |
3798 | 3801 |
3799 } // namespace content | 3802 } // namespace content |
OLD | NEW |