| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/tab_contents/web_contents.h" | 8 #include "chrome/browser/tab_contents/web_contents.h" |
| 9 | 9 |
| 10 class RenderViewHostFactory; | 10 class RenderViewHostFactory; |
| 11 class TestRenderViewHost; | 11 class TestRenderViewHost; |
| 12 | 12 |
| 13 // Subclass WebContents to ensure it creates TestRenderViewHosts and does | 13 // Subclass WebContents to ensure it creates TestRenderViewHosts and does |
| 14 // not do anything involving views. | 14 // not do anything involving views. |
| 15 class TestWebContents : public WebContents { | 15 class TestWebContents : public WebContents { |
| 16 public: | 16 public: |
| 17 // The render view host factory will be passed on to the | 17 // The render view host factory will be passed on to the |
| 18 TestWebContents(Profile* profile, SiteInstance* instance, | 18 TestWebContents(Profile* profile, SiteInstance* instance); |
| 19 RenderViewHostFactory* rvh_factory); | |
| 20 | 19 |
| 21 TestRenderViewHost* pending_rvh(); | 20 TestRenderViewHost* pending_rvh(); |
| 22 | 21 |
| 23 // State accessor. | 22 // State accessor. |
| 24 bool cross_navigation_pending() { | 23 bool cross_navigation_pending() { |
| 25 return render_manager_.cross_navigation_pending_; | 24 return render_manager_.cross_navigation_pending_; |
| 26 } | 25 } |
| 27 | 26 |
| 28 // Overrides WebContents::ShouldTransitionCrossSite so that we can test both | 27 // Overrides WebContents::ShouldTransitionCrossSite so that we can test both |
| 29 // alternatives without using command-line switches. | 28 // alternatives without using command-line switches. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 46 render_view_host->CreateRenderView(); | 45 render_view_host->CreateRenderView(); |
| 47 return true; | 46 return true; |
| 48 } | 47 } |
| 49 void UpdateRenderViewSizeForRenderManager() {} | 48 void UpdateRenderViewSizeForRenderManager() {} |
| 50 | 49 |
| 51 // Set by individual tests. | 50 // Set by individual tests. |
| 52 bool transition_cross_site; | 51 bool transition_cross_site; |
| 53 }; | 52 }; |
| 54 | 53 |
| 55 #endif // CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ | 54 #endif // CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ |
| OLD | NEW |