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