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 "chrome/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 namespace ui_test_utils { | 83 namespace ui_test_utils { |
84 | 84 |
85 namespace { | 85 namespace { |
86 | 86 |
87 class DOMOperationObserver : public content::NotificationObserver, | 87 class DOMOperationObserver : public content::NotificationObserver, |
88 public content::WebContentsObserver { | 88 public content::WebContentsObserver { |
89 public: | 89 public: |
90 explicit DOMOperationObserver(RenderViewHost* render_view_host) | 90 explicit DOMOperationObserver(RenderViewHost* render_view_host) |
91 : content::WebContentsObserver( | 91 : content::WebContentsObserver( |
92 render_view_host->delegate()->GetAsWebContents()), | 92 render_view_host->GetDelegate()->GetAsWebContents()), |
93 did_respond_(false) { | 93 did_respond_(false) { |
94 registrar_.Add(this, content::NOTIFICATION_DOM_OPERATION_RESPONSE, | 94 registrar_.Add(this, content::NOTIFICATION_DOM_OPERATION_RESPONSE, |
95 content::Source<RenderViewHost>(render_view_host)); | 95 content::Source<RenderViewHost>(render_view_host)); |
96 ui_test_utils::RunMessageLoop(); | 96 ui_test_utils::RunMessageLoop(); |
97 } | 97 } |
98 | 98 |
99 virtual void Observe(int type, | 99 virtual void Observe(int type, |
100 const content::NotificationSource& source, | 100 const content::NotificationSource& source, |
101 const content::NotificationDetails& details) OVERRIDE { | 101 const content::NotificationDetails& details) OVERRIDE { |
102 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); | 102 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); | 1130 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); |
1131 } | 1131 } |
1132 | 1132 |
1133 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { | 1133 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { |
1134 DCHECK(bitmap); | 1134 DCHECK(bitmap); |
1135 SnapshotTaker taker; | 1135 SnapshotTaker taker; |
1136 return taker.TakeEntirePageSnapshot(rvh, bitmap); | 1136 return taker.TakeEntirePageSnapshot(rvh, bitmap); |
1137 } | 1137 } |
1138 | 1138 |
1139 } // namespace ui_test_utils | 1139 } // namespace ui_test_utils |
OLD | NEW |