| 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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 | 794 |
| 795 new MHTMLGenerator(this); | 795 new MHTMLGenerator(this); |
| 796 #if defined(OS_MACOSX) | 796 #if defined(OS_MACOSX) |
| 797 new TextInputClientObserver(this); | 797 new TextInputClientObserver(this); |
| 798 #endif // defined(OS_MACOSX) | 798 #endif // defined(OS_MACOSX) |
| 799 | 799 |
| 800 // The next group of objects all implement RenderViewObserver, so are deleted | 800 // The next group of objects all implement RenderViewObserver, so are deleted |
| 801 // along with the RenderView automatically. | 801 // along with the RenderView automatically. |
| 802 mouse_lock_dispatcher_ = new RenderViewMouseLockDispatcher(this); | 802 mouse_lock_dispatcher_ = new RenderViewMouseLockDispatcher(this); |
| 803 | 803 |
| 804 history_controller_.reset(new HistoryController(this)); | 804 // We don't use HistoryController in OOPIF-enabled modes. |
| 805 if (!SiteIsolationPolicy::UseSubframeNavigationEntries()) |
| 806 history_controller_.reset(new HistoryController(this)); |
| 805 | 807 |
| 806 new IdleUserDetector(this); | 808 new IdleUserDetector(this); |
| 807 | 809 |
| 808 if (command_line.HasSwitch(switches::kDomAutomationController)) | 810 if (command_line.HasSwitch(switches::kDomAutomationController)) |
| 809 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; | 811 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; |
| 810 if (command_line.HasSwitch(switches::kStatsCollectionController)) | 812 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
| 811 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; | 813 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; |
| 812 | 814 |
| 813 GetContentClient()->renderer()->RenderViewCreated(this); | 815 GetContentClient()->renderer()->RenderViewCreated(this); |
| 814 | 816 |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 if (in_live_resize) | 1470 if (in_live_resize) |
| 1469 webview()->willStartLiveResize(); | 1471 webview()->willStartLiveResize(); |
| 1470 else | 1472 else |
| 1471 webview()->willEndLiveResize(); | 1473 webview()->willEndLiveResize(); |
| 1472 } | 1474 } |
| 1473 #endif | 1475 #endif |
| 1474 | 1476 |
| 1475 /////////////////////////////////////////////////////////////////////////////// | 1477 /////////////////////////////////////////////////////////////////////////////// |
| 1476 | 1478 |
| 1477 void RenderViewImpl::SendUpdateState() { | 1479 void RenderViewImpl::SendUpdateState() { |
| 1478 // Don't send state updates when using subframe FrameNavigationEntries until | 1480 // We don't use this path in OOPIF-enabled modes. |
| 1479 // PageState and HistoryController have been updated. For now, the current | 1481 DCHECK(!SiteIsolationPolicy::UseSubframeNavigationEntries()); |
| 1480 // entry's root WebHistoryItem sometimes points to data for a subframe (e.g., | |
| 1481 // after a subframe back/forward). | |
| 1482 // TODO(creis): Fix this in https://crbug.com/545219. | |
| 1483 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) | |
| 1484 return; | |
| 1485 | 1482 |
| 1486 HistoryEntry* entry = history_controller_->GetCurrentEntry(); | 1483 HistoryEntry* entry = history_controller_->GetCurrentEntry(); |
| 1487 if (!entry) | 1484 if (!entry) |
| 1488 return; | 1485 return; |
| 1489 | 1486 |
| 1490 // Don't send state updates for kSwappedOutURL. | 1487 // Don't send state updates for kSwappedOutURL. |
| 1491 if (entry->root().urlString() == WebString::fromUTF8(kSwappedOutURL)) | 1488 if (entry->root().urlString() == WebString::fromUTF8(kSwappedOutURL)) |
| 1492 return; | 1489 return; |
| 1493 | 1490 |
| 1494 Send(new ViewHostMsg_UpdateState( | 1491 Send(new ViewHostMsg_UpdateState( |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1853 } | 1850 } |
| 1854 | 1851 |
| 1855 gfx::RectF RenderViewImpl::ClientRectToPhysicalWindowRect( | 1852 gfx::RectF RenderViewImpl::ClientRectToPhysicalWindowRect( |
| 1856 const gfx::RectF& rect) const { | 1853 const gfx::RectF& rect) const { |
| 1857 gfx::RectF window_rect = rect; | 1854 gfx::RectF window_rect = rect; |
| 1858 window_rect.Scale(device_scale_factor_ * webview()->pageScaleFactor()); | 1855 window_rect.Scale(device_scale_factor_ * webview()->pageScaleFactor()); |
| 1859 return window_rect; | 1856 return window_rect; |
| 1860 } | 1857 } |
| 1861 | 1858 |
| 1862 void RenderViewImpl::StartNavStateSyncTimerIfNecessary() { | 1859 void RenderViewImpl::StartNavStateSyncTimerIfNecessary() { |
| 1860 // TODO(creis): Move this to RenderFrameHost. In the meantime, we'll ignore |
| 1861 // state changes between navigation events in OOPIF-enabled modes. |
| 1862 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) |
| 1863 return; |
| 1864 |
| 1863 int delay; | 1865 int delay; |
| 1864 if (send_content_state_immediately_) | 1866 if (send_content_state_immediately_) |
| 1865 delay = 0; | 1867 delay = 0; |
| 1866 else if (is_hidden()) | 1868 else if (is_hidden()) |
| 1867 delay = kDelaySecondsForContentStateSyncHidden; | 1869 delay = kDelaySecondsForContentStateSyncHidden; |
| 1868 else | 1870 else |
| 1869 delay = kDelaySecondsForContentStateSync; | 1871 delay = kDelaySecondsForContentStateSync; |
| 1870 | 1872 |
| 1871 if (nav_state_sync_timer_.IsRunning()) { | 1873 if (nav_state_sync_timer_.IsRunning()) { |
| 1872 // The timer is already running. If the delay of the timer maches the amount | 1874 // The timer is already running. If the delay of the timer maches the amount |
| (...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3718 if (IsUseZoomForDSFEnabled()) { | 3720 if (IsUseZoomForDSFEnabled()) { |
| 3719 compositor_->SetPaintedDeviceScaleFactor(device_scale_factor_); | 3721 compositor_->SetPaintedDeviceScaleFactor(device_scale_factor_); |
| 3720 webview()->setZoomFactorForDeviceScaleFactor( | 3722 webview()->setZoomFactorForDeviceScaleFactor( |
| 3721 device_scale_factor_); | 3723 device_scale_factor_); |
| 3722 } else { | 3724 } else { |
| 3723 webview()->setDeviceScaleFactor(device_scale_factor_); | 3725 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 3724 } | 3726 } |
| 3725 } | 3727 } |
| 3726 | 3728 |
| 3727 } // namespace content | 3729 } // namespace content |
| OLD | NEW |