| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "content/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 | 1781 |
| 1782 if (nav_state_sync_timer_.IsRunning()) { | 1782 if (nav_state_sync_timer_.IsRunning()) { |
| 1783 // The timer is already running. If the delay of the timer maches the amount | 1783 // The timer is already running. If the delay of the timer maches the amount |
| 1784 // we want to delay by, then return. Otherwise stop the timer so that it | 1784 // we want to delay by, then return. Otherwise stop the timer so that it |
| 1785 // gets started with the right delay. | 1785 // gets started with the right delay. |
| 1786 if (nav_state_sync_timer_.GetCurrentDelay().InSeconds() == delay) | 1786 if (nav_state_sync_timer_.GetCurrentDelay().InSeconds() == delay) |
| 1787 return; | 1787 return; |
| 1788 nav_state_sync_timer_.Stop(); | 1788 nav_state_sync_timer_.Stop(); |
| 1789 } | 1789 } |
| 1790 | 1790 |
| 1791 nav_state_sync_timer_.Start(FROM_HERE, TimeDelta::FromSeconds(delay), this, | 1791 nav_state_sync_timer_.Start( |
| 1792 &RenderView::SyncNavigationState); | 1792 TimeDelta::FromSeconds(delay), this, &RenderView::SyncNavigationState); |
| 1793 } | 1793 } |
| 1794 | 1794 |
| 1795 void RenderView::setMouseOverURL(const WebURL& url) { | 1795 void RenderView::setMouseOverURL(const WebURL& url) { |
| 1796 mouse_over_url_ = GURL(url); | 1796 mouse_over_url_ = GURL(url); |
| 1797 UpdateTargetURL(mouse_over_url_, focus_url_); | 1797 UpdateTargetURL(mouse_over_url_, focus_url_); |
| 1798 } | 1798 } |
| 1799 | 1799 |
| 1800 void RenderView::setKeyboardFocusURL(const WebURL& url) { | 1800 void RenderView::setKeyboardFocusURL(const WebURL& url) { |
| 1801 focus_url_ = GURL(url); | 1801 focus_url_ = GURL(url); |
| 1802 UpdateTargetURL(focus_url_, mouse_over_url_); | 1802 UpdateTargetURL(focus_url_, mouse_over_url_); |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2835 | 2835 |
| 2836 void RenderView::didUpdateLayout(WebFrame* frame) { | 2836 void RenderView::didUpdateLayout(WebFrame* frame) { |
| 2837 // We don't always want to set up a timer, only if we've been put in that | 2837 // We don't always want to set up a timer, only if we've been put in that |
| 2838 // mode by getting a |ViewMsg_EnablePreferredSizeChangedMode| | 2838 // mode by getting a |ViewMsg_EnablePreferredSizeChangedMode| |
| 2839 // message. | 2839 // message. |
| 2840 if (!send_preferred_size_changes_ || !webview()) | 2840 if (!send_preferred_size_changes_ || !webview()) |
| 2841 return; | 2841 return; |
| 2842 | 2842 |
| 2843 if (check_preferred_size_timer_.IsRunning()) | 2843 if (check_preferred_size_timer_.IsRunning()) |
| 2844 return; | 2844 return; |
| 2845 check_preferred_size_timer_.Start(FROM_HERE, | 2845 check_preferred_size_timer_.Start(TimeDelta::FromMilliseconds(0), this, |
| 2846 TimeDelta::FromMilliseconds(0), this, | |
| 2847 &RenderView::CheckPreferredSize); | 2846 &RenderView::CheckPreferredSize); |
| 2848 } | 2847 } |
| 2849 | 2848 |
| 2850 void RenderView::CheckPreferredSize() { | 2849 void RenderView::CheckPreferredSize() { |
| 2851 // We don't always want to send the change messages over IPC, only if we've | 2850 // We don't always want to send the change messages over IPC, only if we've |
| 2852 // been put in that mode by getting a |ViewMsg_EnablePreferredSizeChangedMode| | 2851 // been put in that mode by getting a |ViewMsg_EnablePreferredSizeChangedMode| |
| 2853 // message. | 2852 // message. |
| 2854 if (!send_preferred_size_changes_ || !webview()) | 2853 if (!send_preferred_size_changes_ || !webview()) |
| 2855 return; | 2854 return; |
| 2856 | 2855 |
| (...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4581 } | 4580 } |
| 4582 | 4581 |
| 4583 void RenderView::OnEnableViewSourceMode() { | 4582 void RenderView::OnEnableViewSourceMode() { |
| 4584 if (!webview()) | 4583 if (!webview()) |
| 4585 return; | 4584 return; |
| 4586 WebFrame* main_frame = webview()->mainFrame(); | 4585 WebFrame* main_frame = webview()->mainFrame(); |
| 4587 if (!main_frame) | 4586 if (!main_frame) |
| 4588 return; | 4587 return; |
| 4589 main_frame->enableViewSourceMode(true); | 4588 main_frame->enableViewSourceMode(true); |
| 4590 } | 4589 } |
| OLD | NEW |