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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 params->never_visible), | 659 params->never_visible), |
660 webkit_preferences_(params->webkit_prefs), | 660 webkit_preferences_(params->webkit_prefs), |
661 send_content_state_immediately_(false), | 661 send_content_state_immediately_(false), |
662 enabled_bindings_(0), | 662 enabled_bindings_(0), |
663 send_preferred_size_changes_(false), | 663 send_preferred_size_changes_(false), |
664 navigation_gesture_(NavigationGestureUnknown), | 664 navigation_gesture_(NavigationGestureUnknown), |
665 opened_by_user_gesture_(true), | 665 opened_by_user_gesture_(true), |
666 opener_suppressed_(false), | 666 opener_suppressed_(false), |
667 suppress_dialogs_until_swap_out_(false), | 667 suppress_dialogs_until_swap_out_(false), |
668 page_id_(-1), | 668 page_id_(-1), |
| 669 page_id_not_yet_reported_(false), |
669 last_page_id_sent_to_browser_(-1), | 670 last_page_id_sent_to_browser_(-1), |
670 next_page_id_(params->next_page_id), | 671 next_page_id_(params->next_page_id), |
671 history_list_offset_(-1), | 672 history_list_offset_(-1), |
672 history_list_length_(0), | 673 history_list_length_(0), |
673 frames_in_progress_(0), | 674 frames_in_progress_(0), |
674 target_url_status_(TARGET_NONE), | 675 target_url_status_(TARGET_NONE), |
675 uses_temporary_zoom_level_(false), | 676 uses_temporary_zoom_level_(false), |
676 #if defined(OS_ANDROID) | 677 #if defined(OS_ANDROID) |
677 top_controls_constraints_(cc::BOTH), | 678 top_controls_constraints_(cc::BOTH), |
678 #endif | 679 #endif |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 } | 1543 } |
1543 | 1544 |
1544 void RenderViewImpl::SendUpdateState(HistoryEntry* entry) { | 1545 void RenderViewImpl::SendUpdateState(HistoryEntry* entry) { |
1545 if (!entry) | 1546 if (!entry) |
1546 return; | 1547 return; |
1547 | 1548 |
1548 // Don't send state updates for kSwappedOutURL. | 1549 // Don't send state updates for kSwappedOutURL. |
1549 if (entry->root().urlString() == WebString::fromUTF8(kSwappedOutURL)) | 1550 if (entry->root().urlString() == WebString::fromUTF8(kSwappedOutURL)) |
1550 return; | 1551 return; |
1551 | 1552 |
| 1553 CHECK(!page_id_not_yet_reported_); |
1552 Send(new ViewHostMsg_UpdateState( | 1554 Send(new ViewHostMsg_UpdateState( |
1553 routing_id_, page_id_, HistoryEntryToPageState(entry))); | 1555 routing_id_, page_id_, HistoryEntryToPageState(entry))); |
1554 } | 1556 } |
1555 | 1557 |
1556 bool RenderViewImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) { | 1558 bool RenderViewImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) { |
1557 // Before WebKit asks us to show an alert (etc.), it takes care of doing the | 1559 // Before WebKit asks us to show an alert (etc.), it takes care of doing the |
1558 // equivalent of WebView::willEnterModalLoop. In the case of showModalDialog | 1560 // equivalent of WebView::willEnterModalLoop. In the case of showModalDialog |
1559 // it is particularly important that we do not call willEnterModalLoop as | 1561 // it is particularly important that we do not call willEnterModalLoop as |
1560 // that would defer resource loads for the dialog itself. | 1562 // that would defer resource loads for the dialog itself. |
1561 if (RenderThreadImpl::current()) // Will be NULL during unit tests. | 1563 if (RenderThreadImpl::current()) // Will be NULL during unit tests. |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1860 // If we have a request in-flight, save the URL to be sent when we | 1862 // If we have a request in-flight, save the URL to be sent when we |
1861 // receive an ACK to the in-flight request. We can happily overwrite | 1863 // receive an ACK to the in-flight request. We can happily overwrite |
1862 // any existing pending sends. | 1864 // any existing pending sends. |
1863 pending_target_url_ = latest_url; | 1865 pending_target_url_ = latest_url; |
1864 target_url_status_ = TARGET_PENDING; | 1866 target_url_status_ = TARGET_PENDING; |
1865 } else { | 1867 } else { |
1866 // URLs larger than |MaxURLChars()| cannot be sent through IPC - | 1868 // URLs larger than |MaxURLChars()| cannot be sent through IPC - |
1867 // see |ParamTraits<GURL>|. | 1869 // see |ParamTraits<GURL>|. |
1868 if (latest_url.possibly_invalid_spec().size() > GetMaxURLChars()) | 1870 if (latest_url.possibly_invalid_spec().size() > GetMaxURLChars()) |
1869 latest_url = GURL(); | 1871 latest_url = GURL(); |
| 1872 CHECK(!page_id_not_yet_reported_); |
1870 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, page_id_, latest_url)); | 1873 Send(new ViewHostMsg_UpdateTargetURL(routing_id_, page_id_, latest_url)); |
1871 target_url_ = latest_url; | 1874 target_url_ = latest_url; |
1872 target_url_status_ = TARGET_INFLIGHT; | 1875 target_url_status_ = TARGET_INFLIGHT; |
1873 } | 1876 } |
1874 } | 1877 } |
1875 | 1878 |
1876 gfx::RectF RenderViewImpl::ClientRectToPhysicalWindowRect( | 1879 gfx::RectF RenderViewImpl::ClientRectToPhysicalWindowRect( |
1877 const gfx::RectF& rect) const { | 1880 const gfx::RectF& rect) const { |
1878 gfx::RectF window_rect = rect; | 1881 gfx::RectF window_rect = rect; |
1879 window_rect.Scale(device_scale_factor_ * webview()->pageScaleFactor()); | 1882 window_rect.Scale(device_scale_factor_ * webview()->pageScaleFactor()); |
(...skipping 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4191 std::vector<gfx::Size> sizes; | 4194 std::vector<gfx::Size> sizes; |
4192 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4195 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4193 if (!url.isEmpty()) | 4196 if (!url.isEmpty()) |
4194 urls.push_back( | 4197 urls.push_back( |
4195 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4198 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4196 } | 4199 } |
4197 SendUpdateFaviconURL(urls); | 4200 SendUpdateFaviconURL(urls); |
4198 } | 4201 } |
4199 | 4202 |
4200 } // namespace content | 4203 } // namespace content |
OLD | NEW |