Chromium Code Reviews| 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 check_preferred_size_timer_.Stop(); | |
|
jamesr
2011/05/24 20:31:25
shouldn't this have the checks in CheckPreferredSi
| |
| 2720 preferred_size_change_timer_.Start(TimeDelta::FromMilliseconds(10), this, | |
| 2721 &RenderView::CheckPreferredSize); | |
| 2722 } | |
| 2723 | |
| 2718 void RenderView::CheckPreferredSize() { | 2724 void RenderView::CheckPreferredSize() { |
| 2719 // We don't always want to send the change messages over IPC, only if we've | 2725 // 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| | 2726 // be put in that mode by getting a |ViewMsg_EnablePreferredSizeChangedMode| |
| 2721 // message. | 2727 // message. |
| 2722 if (!send_preferred_size_changes_ || !webview()) | 2728 if (!send_preferred_size_changes_ || !webview()) |
| 2723 return; | 2729 return; |
| 2724 | 2730 |
| 2725 // WebCore likes to tell us things have changed even when they haven't, so | 2731 // 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 | 2732 // cache the width and height and only send the IPC message when we're sure |
| 2727 // they're different. | 2733 // they're different. |
| (...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4179 const webkit_glue::CustomContextMenuContext& custom_context) { | 4185 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 4180 if (custom_context.is_pepper_menu) | 4186 if (custom_context.is_pepper_menu) |
| 4181 pepper_delegate_.OnContextMenuClosed(custom_context); | 4187 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 4182 else | 4188 else |
| 4183 context_menu_node_.reset(); | 4189 context_menu_node_.reset(); |
| 4184 } | 4190 } |
| 4185 | 4191 |
| 4186 void RenderView::OnNetworkStateChanged(bool online) { | 4192 void RenderView::OnNetworkStateChanged(bool online) { |
| 4187 WebNetworkStateNotifier::setOnLine(online); | 4193 WebNetworkStateNotifier::setOnLine(online); |
| 4188 } | 4194 } |
| OLD | NEW |