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 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2708 RenderViewObserver, | 2708 RenderViewObserver, |
2709 observers_, | 2709 observers_, |
2710 LogCrossFramePropertyAccess( | 2710 LogCrossFramePropertyAccess( |
2711 frame, target, cross_origin, property_name, event_id)); | 2711 frame, target, cross_origin, property_name, event_id)); |
2712 } | 2712 } |
2713 | 2713 |
2714 void RenderView::didChangeContentsSize(WebFrame* frame, const WebSize& size) { | 2714 void RenderView::didChangeContentsSize(WebFrame* frame, const WebSize& size) { |
2715 CheckPreferredSize(); | 2715 CheckPreferredSize(); |
2716 } | 2716 } |
2717 | 2717 |
2718 void RenderView::mayHaveChangedRenderedSize(WebFrame* frame) { | |
2719 if (!send_preferred_size_changes_ || !webview()) | |
2720 return; | |
2721 // If we hit this code path, then stop the deprecated timer. | |
2722 check_preferred_size_timer_.Stop(); | |
2723 preferred_size_change_timer_.Stop(); | |
2724 preferred_size_change_timer_.Start(TimeDelta::FromMilliseconds(10), this, | |
jamesr
2011/05/24 22:53:33
based on what base/timer.h says i think this Stop/
levin
2011/05/24 23:00:23
Good catch. I missed that call actually, but I don
| |
2725 &RenderView::CheckPreferredSize); | |
2726 } | |
2727 | |
2718 void RenderView::CheckPreferredSize() { | 2728 void RenderView::CheckPreferredSize() { |
2719 // We don't always want to send the change messages over IPC, only if we've | 2729 // We don't always want to send the change messages over IPC, only if we've |
2720 // be put in that mode by getting a |ViewMsg_EnablePreferredSizeChangedMode| | 2730 // be put in that mode by getting a |ViewMsg_EnablePreferredSizeChangedMode| |
2721 // message. | 2731 // message. |
2722 if (!send_preferred_size_changes_ || !webview()) | 2732 if (!send_preferred_size_changes_ || !webview()) |
2723 return; | 2733 return; |
2724 | 2734 |
2725 // WebCore likes to tell us things have changed even when they haven't, so | 2735 // WebCore likes to tell us things have changed even when they haven't, so |
2726 // cache the width and height and only send the IPC message when we're sure | 2736 // cache the width and height and only send the IPC message when we're sure |
2727 // they're different. | 2737 // they're different. |
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4179 const webkit_glue::CustomContextMenuContext& custom_context) { | 4189 const webkit_glue::CustomContextMenuContext& custom_context) { |
4180 if (custom_context.is_pepper_menu) | 4190 if (custom_context.is_pepper_menu) |
4181 pepper_delegate_.OnContextMenuClosed(custom_context); | 4191 pepper_delegate_.OnContextMenuClosed(custom_context); |
4182 else | 4192 else |
4183 context_menu_node_.reset(); | 4193 context_menu_node_.reset(); |
4184 } | 4194 } |
4185 | 4195 |
4186 void RenderView::OnNetworkStateChanged(bool online) { | 4196 void RenderView::OnNetworkStateChanged(bool online) { |
4187 WebNetworkStateNotifier::setOnLine(online); | 4197 WebNetworkStateNotifier::setOnLine(online); |
4188 } | 4198 } |
OLD | NEW |