| 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 "android_webview/renderer/aw_render_view_ext.h" | 5 #include "android_webview/renderer/aw_render_view_ext.h" |
| 6 #include "android_webview/common/render_view_messages.h" | 6 #include "android_webview/common/render_view_messages.h" |
| 7 #include "content/public/renderer/render_frame.h" | 7 #include "content/public/renderer/render_frame.h" |
| 8 #include "content/public/renderer/render_view.h" | 8 #include "content/public/renderer/render_view.h" |
| 9 #include "third_party/WebKit/public/web/WebFrame.h" | 9 #include "third_party/WebKit/public/web/WebFrame.h" |
| 10 #include "third_party/WebKit/public/web/WebView.h" | 10 #include "third_party/WebKit/public/web/WebView.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 void AwRenderViewExt::DidCommitCompositorFrame() { | 24 void AwRenderViewExt::DidCommitCompositorFrame() { |
| 25 PostCheckContentsSize(); | 25 PostCheckContentsSize(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void AwRenderViewExt::DidUpdateLayout() { | 28 void AwRenderViewExt::DidUpdateLayout() { |
| 29 PostCheckContentsSize(); | 29 PostCheckContentsSize(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void AwRenderViewExt::OnDestruct() { |
| 33 delete this; |
| 34 } |
| 35 |
| 32 void AwRenderViewExt::PostCheckContentsSize() { | 36 void AwRenderViewExt::PostCheckContentsSize() { |
| 33 if (check_contents_size_timer_.IsRunning()) | 37 if (check_contents_size_timer_.IsRunning()) |
| 34 return; | 38 return; |
| 35 | 39 |
| 36 check_contents_size_timer_.Start(FROM_HERE, | 40 check_contents_size_timer_.Start(FROM_HERE, |
| 37 base::TimeDelta::FromMilliseconds(0), this, | 41 base::TimeDelta::FromMilliseconds(0), this, |
| 38 &AwRenderViewExt::CheckContentsSize); | 42 &AwRenderViewExt::CheckContentsSize); |
| 39 } | 43 } |
| 40 | 44 |
| 41 void AwRenderViewExt::CheckContentsSize() { | 45 void AwRenderViewExt::CheckContentsSize() { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 66 | 70 |
| 67 if (contents_size == last_sent_contents_size_) | 71 if (contents_size == last_sent_contents_size_) |
| 68 return; | 72 return; |
| 69 | 73 |
| 70 last_sent_contents_size_ = contents_size; | 74 last_sent_contents_size_ = contents_size; |
| 71 main_render_frame->Send(new AwViewHostMsg_OnContentsSizeChanged( | 75 main_render_frame->Send(new AwViewHostMsg_OnContentsSizeChanged( |
| 72 main_render_frame->GetRoutingID(), contents_size)); | 76 main_render_frame->GetRoutingID(), contents_size)); |
| 73 } | 77 } |
| 74 | 78 |
| 75 } // namespace android_webview | 79 } // namespace android_webview |
| OLD | NEW |