| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 public: | 128 public: |
| 129 explicit TestWebViewWidgetClient(TestWebViewClient* testWebViewClient) | 129 explicit TestWebViewWidgetClient(TestWebViewClient* testWebViewClient) |
| 130 : m_testWebViewClient(testWebViewClient) | 130 : m_testWebViewClient(testWebViewClient) |
| 131 { | 131 { |
| 132 } | 132 } |
| 133 virtual ~TestWebViewWidgetClient() {} | 133 virtual ~TestWebViewWidgetClient() {} |
| 134 | 134 |
| 135 void initializeLayerTreeView() override; | 135 void initializeLayerTreeView() override; |
| 136 WebLayerTreeView* layerTreeView() override; | 136 WebLayerTreeView* layerTreeView() override; |
| 137 void scheduleAnimation() override; | 137 void scheduleAnimation() override; |
| 138 void didMeaningfulLayout(WebMeaningfulLayout) override; |
| 138 | 139 |
| 139 private: | 140 private: |
| 140 TestWebViewClient* m_testWebViewClient; | 141 TestWebViewClient* m_testWebViewClient; |
| 141 }; | 142 }; |
| 142 | 143 |
| 143 class TestWebViewClient : public WebViewClient { | 144 class TestWebViewClient : public WebViewClient { |
| 144 public: | 145 public: |
| 145 TestWebViewClient() | 146 TestWebViewClient() |
| 146 : m_testWebWidgetClient(this) | 147 : m_testWebWidgetClient(this) |
| 147 , m_animationScheduled(false) | 148 , m_animationScheduled(false) |
| 148 { | 149 { |
| 149 } | 150 } |
| 150 virtual ~TestWebViewClient() { } | 151 virtual ~TestWebViewClient() { } |
| 151 void initializeLayerTreeView() override; | 152 void initializeLayerTreeView() override; |
| 152 WebLayerTreeView* layerTreeView() override { return m_layerTreeView.get(); } | 153 WebLayerTreeView* layerTreeView() override { return m_layerTreeView.get(); } |
| 153 | 154 |
| 154 void scheduleAnimation() override { m_animationScheduled = true; } | 155 void scheduleAnimation() override { m_animationScheduled = true; } |
| 155 bool animationScheduled() { return m_animationScheduled; } | 156 bool animationScheduled() { return m_animationScheduled; } |
| 156 void clearAnimationScheduled() { m_animationScheduled = false; } | 157 void clearAnimationScheduled() { m_animationScheduled = false; } |
| 157 | 158 |
| 158 // TODO(lfg): This is a temporary method to retrieve the WebWidgetClient, | 159 // TODO(lfg): This is a temporary method to retrieve the WebWidgetClient, |
| 159 // while we refactor WebView to not inherit from Webwidget. | 160 // while we refactor WebView to not inherit from Webwidget. |
| 160 // Returns the WebWidgetClient. | 161 // Returns the WebWidgetClient. |
| 161 TestWebWidgetClient* widgetClient() { return &m_testWebWidgetClient; } | 162 TestWebWidgetClient* widgetClient() { return &m_testWebWidgetClient; } |
| 162 | 163 |
| 163 private: | 164 private: |
| 165 friend class TestWebViewWidgetClient; |
| 166 |
| 164 TestWebViewWidgetClient m_testWebWidgetClient; | 167 TestWebViewWidgetClient m_testWebWidgetClient; |
| 165 std::unique_ptr<WebLayerTreeView> m_layerTreeView; | 168 std::unique_ptr<WebLayerTreeView> m_layerTreeView; |
| 166 bool m_animationScheduled; | 169 bool m_animationScheduled; |
| 167 }; | 170 }; |
| 168 | 171 |
| 169 // Convenience class for handling the lifetime of a WebView and its associated m
ainframe in tests. | 172 // Convenience class for handling the lifetime of a WebView and its associated m
ainframe in tests. |
| 170 class WebViewHelper { | 173 class WebViewHelper { |
| 171 WTF_MAKE_NONCOPYABLE(WebViewHelper); | 174 WTF_MAKE_NONCOPYABLE(WebViewHelper); |
| 172 public: | 175 public: |
| 173 WebViewHelper(SettingOverrider* = 0); | 176 WebViewHelper(SettingOverrider* = 0); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 WebDOMMessageEvent) override { } | 236 WebDOMMessageEvent) override { } |
| 234 | 237 |
| 235 private: | 238 private: |
| 236 Persistent<WebRemoteFrameImpl> const m_frame; | 239 Persistent<WebRemoteFrameImpl> const m_frame; |
| 237 }; | 240 }; |
| 238 | 241 |
| 239 } // namespace FrameTestHelpers | 242 } // namespace FrameTestHelpers |
| 240 } // namespace blink | 243 } // namespace blink |
| 241 | 244 |
| 242 #endif // FrameTestHelpers_h | 245 #endif // FrameTestHelpers_h |
| OLD | NEW |