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/test/test_render_view_host.h" | 5 #include "content/test/test_render_view_host.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
9 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 9 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
10 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 10 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 params->security_info = std::string(); | 41 params->security_info = std::string(); |
42 params->gesture = NavigationGestureUser; | 42 params->gesture = NavigationGestureUser; |
43 params->was_within_same_page = false; | 43 params->was_within_same_page = false; |
44 params->is_post = false; | 44 params->is_post = false; |
45 params->page_state = PageState::CreateFromURL(url); | 45 params->page_state = PageState::CreateFromURL(url); |
46 } | 46 } |
47 | 47 |
48 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) | 48 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) |
49 : rwh_(RenderWidgetHostImpl::From(rwh)), | 49 : rwh_(RenderWidgetHostImpl::From(rwh)), |
50 is_showing_(false), | 50 is_showing_(false), |
| 51 is_occluded_(false), |
51 did_swap_compositor_frame_(false) { | 52 did_swap_compositor_frame_(false) { |
52 rwh_->SetView(this); | 53 rwh_->SetView(this); |
53 } | 54 } |
54 | 55 |
55 TestRenderWidgetHostView::~TestRenderWidgetHostView() { | 56 TestRenderWidgetHostView::~TestRenderWidgetHostView() { |
56 } | 57 } |
57 | 58 |
58 RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const { | 59 RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const { |
59 return NULL; | 60 return NULL; |
60 } | 61 } |
(...skipping 21 matching lines...) Expand all Loading... |
82 bool TestRenderWidgetHostView::HasFocus() const { | 83 bool TestRenderWidgetHostView::HasFocus() const { |
83 return true; | 84 return true; |
84 } | 85 } |
85 | 86 |
86 bool TestRenderWidgetHostView::IsSurfaceAvailableForCopy() const { | 87 bool TestRenderWidgetHostView::IsSurfaceAvailableForCopy() const { |
87 return true; | 88 return true; |
88 } | 89 } |
89 | 90 |
90 void TestRenderWidgetHostView::Show() { | 91 void TestRenderWidgetHostView::Show() { |
91 is_showing_ = true; | 92 is_showing_ = true; |
| 93 is_occluded_ = false; |
92 } | 94 } |
93 | 95 |
94 void TestRenderWidgetHostView::Hide() { | 96 void TestRenderWidgetHostView::Hide() { |
95 is_showing_ = false; | 97 is_showing_ = false; |
96 } | 98 } |
97 | 99 |
98 bool TestRenderWidgetHostView::IsShowing() { | 100 bool TestRenderWidgetHostView::IsShowing() { |
99 return is_showing_; | 101 return is_showing_; |
100 } | 102 } |
101 | 103 |
| 104 void TestRenderWidgetHostView::WasUnOccluded() { |
| 105 is_occluded_ = false; |
| 106 } |
| 107 |
| 108 void TestRenderWidgetHostView::WasOccluded() { |
| 109 is_occluded_ = true; |
| 110 } |
| 111 |
102 void TestRenderWidgetHostView::RenderProcessGone(base::TerminationStatus status, | 112 void TestRenderWidgetHostView::RenderProcessGone(base::TerminationStatus status, |
103 int error_code) { | 113 int error_code) { |
104 delete this; | 114 delete this; |
105 } | 115 } |
106 | 116 |
107 void TestRenderWidgetHostView::Destroy() { delete this; } | 117 void TestRenderWidgetHostView::Destroy() { delete this; } |
108 | 118 |
109 gfx::Rect TestRenderWidgetHostView::GetViewBounds() const { | 119 gfx::Rect TestRenderWidgetHostView::GetViewBounds() const { |
110 return gfx::Rect(); | 120 return gfx::Rect(); |
111 } | 121 } |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 305 |
296 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { | 306 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { |
297 return contents()->GetMainFrame(); | 307 return contents()->GetMainFrame(); |
298 } | 308 } |
299 | 309 |
300 TestWebContents* RenderViewHostImplTestHarness::contents() { | 310 TestWebContents* RenderViewHostImplTestHarness::contents() { |
301 return static_cast<TestWebContents*>(web_contents()); | 311 return static_cast<TestWebContents*>(web_contents()); |
302 } | 312 } |
303 | 313 |
304 } // namespace content | 314 } // namespace content |
OLD | NEW |