OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TAB_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/tab_contents/tab_contents.h" | 9 #include "chrome/browser/tab_contents/tab_contents.h" |
10 #include "chrome/common/notification_registrar.h" | 10 #include "chrome/common/notification_registrar.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // State accessor. | 25 // State accessor. |
26 bool cross_navigation_pending() { | 26 bool cross_navigation_pending() { |
27 return render_manager_.cross_navigation_pending_; | 27 return render_manager_.cross_navigation_pending_; |
28 } | 28 } |
29 | 29 |
30 // Overrides TabContents::ShouldTransitionCrossSite so that we can test both | 30 // Overrides TabContents::ShouldTransitionCrossSite so that we can test both |
31 // alternatives without using command-line switches. | 31 // alternatives without using command-line switches. |
32 bool ShouldTransitionCrossSite() { return transition_cross_site; } | 32 bool ShouldTransitionCrossSite() { return transition_cross_site; } |
33 | 33 |
34 // Overrides TabContents::Observe. We are listening to infobar related | |
35 // notifications so we can call InfoBarClosed() on the infobar delegates to | |
36 // prevent them from leaking. | |
37 virtual void Observe(NotificationType type, | |
38 const NotificationSource& source, | |
39 const NotificationDetails& details); | |
40 | |
41 // Promote DidNavigate to public. | 34 // Promote DidNavigate to public. |
42 void TestDidNavigate(RenderViewHost* render_view_host, | 35 void TestDidNavigate(RenderViewHost* render_view_host, |
43 const ViewHostMsg_FrameNavigate_Params& params) { | 36 const ViewHostMsg_FrameNavigate_Params& params) { |
44 DidNavigate(render_view_host, params); | 37 DidNavigate(render_view_host, params); |
45 } | 38 } |
46 | 39 |
47 // Promote GetWebkitPrefs to public. | 40 // Promote GetWebkitPrefs to public. |
48 WebPreferences TestGetWebkitPrefs() { | 41 WebPreferences TestGetWebkitPrefs() { |
49 return GetWebkitPrefs(); | 42 return GetWebkitPrefs(); |
50 } | 43 } |
(...skipping 15 matching lines...) Expand all Loading... |
66 // sending a navigate notification for the NavigationController pending entry. | 59 // sending a navigate notification for the NavigationController pending entry. |
67 void CommitPendingNavigation(); | 60 void CommitPendingNavigation(); |
68 | 61 |
69 // Simulates the current RVH notifying that it has unloaded so that the | 62 // Simulates the current RVH notifying that it has unloaded so that the |
70 // pending RVH navigation can proceed. | 63 // pending RVH navigation can proceed. |
71 // Does nothing if no cross-navigation is pending. | 64 // Does nothing if no cross-navigation is pending. |
72 void ProceedWithCrossSiteNavigation(); | 65 void ProceedWithCrossSiteNavigation(); |
73 | 66 |
74 // Set by individual tests. | 67 // Set by individual tests. |
75 bool transition_cross_site; | 68 bool transition_cross_site; |
76 | |
77 NotificationRegistrar registrar_; | |
78 }; | 69 }; |
79 | 70 |
80 #endif // CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ | 71 #endif // CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ |
OLD | NEW |