| 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 #include "chrome/browser/tab_contents/test_tab_contents.h" | 5 #include "chrome/browser/tab_contents/test_tab_contents.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_url_handler.h" | 7 #include "chrome/browser/browser_url_handler.h" |
| 8 #include "chrome/browser/renderer_host/mock_render_process_host.h" | 8 #include "chrome/browser/renderer_host/mock_render_process_host.h" |
| 9 #include "chrome/browser/renderer_host/render_view_host.h" | 9 #include "chrome/browser/renderer_host/render_view_host.h" |
| 10 #include "chrome/browser/renderer_host/site_instance.h" | 10 #include "chrome/browser/renderer_host/site_instance.h" |
| 11 #include "chrome/browser/renderer_host/test/test_render_view_host.h" | 11 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
| 12 #include "chrome/browser/tab_contents/infobar_delegate.h" | 12 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 13 #include "chrome/common/notification_service.h" | 13 #include "chrome/common/notification_service.h" |
| 14 | 14 |
| 15 TestTabContents::TestTabContents(Profile* profile, SiteInstance* instance) | 15 TestTabContents::TestTabContents(Profile* profile, SiteInstance* instance) |
| 16 : TabContents(profile, instance, MSG_ROUTING_NONE, NULL), | 16 : TabContents(profile, instance, MSG_ROUTING_NONE, NULL, NULL), |
| 17 transition_cross_site(false) { | 17 transition_cross_site(false) { |
| 18 // Listen for infobar events so we can call InfoBarClosed() on the infobar | 18 // Listen for infobar events so we can call InfoBarClosed() on the infobar |
| 19 // delegates and give them an opportunity to delete themselves. (Since we | 19 // delegates and give them an opportunity to delete themselves. (Since we |
| 20 // have no InfobarContainer in TestTabContents, InfoBarClosed() is not called | 20 // have no InfobarContainer in TestTabContents, InfoBarClosed() is not called |
| 21 // most likely leading to the infobar delegates being leaked.) | 21 // most likely leading to the infobar delegates being leaked.) |
| 22 Source<TabContents> source(this); | 22 Source<TabContents> source(this); |
| 23 registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED, | 23 registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED, |
| 24 source); | 24 source); |
| 25 registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REPLACED, | 25 registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REPLACED, |
| 26 source); | 26 source); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 static_cast<MockRenderProcessHost*>(rvh->process())->max_page_id() + 1; | 94 static_cast<MockRenderProcessHost*>(rvh->process())->max_page_id() + 1; |
| 95 } | 95 } |
| 96 rvh->SendNavigate(page_id, entry->url()); | 96 rvh->SendNavigate(page_id, entry->url()); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void TestTabContents::ProceedWithCrossSiteNavigation() { | 99 void TestTabContents::ProceedWithCrossSiteNavigation() { |
| 100 if (!pending_rvh()) | 100 if (!pending_rvh()) |
| 101 return; | 101 return; |
| 102 render_manager_.ShouldClosePage(true, true); | 102 render_manager_.ShouldClosePage(true, true); |
| 103 } | 103 } |
| OLD | NEW |