Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Unified Diff: chrome/browser/tab_contents/test_tab_contents.cc

Issue 4767001: Make TabContents own its infobar delegates.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/tab_contents/test_tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/test_tab_contents.cc (revision 65711)
+++ chrome/browser/tab_contents/test_tab_contents.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -15,36 +15,8 @@
TestTabContents::TestTabContents(Profile* profile, SiteInstance* instance)
: TabContents(profile, instance, MSG_ROUTING_NONE, NULL, NULL),
transition_cross_site(false) {
- // Listen for infobar events so we can call InfoBarClosed() on the infobar
- // delegates and give them an opportunity to delete themselves. (Since we
- // have no InfobarContainer in TestTabContents, InfoBarClosed() is not called
- // most likely leading to the infobar delegates being leaked.)
- Source<TabContents> source(this);
- registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED,
- source);
- registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REPLACED,
- source);
}
-void TestTabContents::Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- // TabContents does not handle TAB_CONTENTS_INFOBAR_* so we don't pass it
- // these notifications.
- switch (type.value) {
- case NotificationType::TAB_CONTENTS_INFOBAR_REMOVED:
- Details<InfoBarDelegate>(details).ptr()->InfoBarClosed();
- break;
- case NotificationType::TAB_CONTENTS_INFOBAR_REPLACED:
- Details<std::pair<InfoBarDelegate*, InfoBarDelegate*> >(details).ptr()->
- first->InfoBarClosed();
- break;
- default:
- TabContents::Observe(type, source, details);
- break;
- }
-}
-
TestRenderViewHost* TestTabContents::pending_rvh() const {
return static_cast<TestRenderViewHost*>(
render_manager_.pending_render_view_host_);

Powered by Google App Engine
This is Rietveld 408576698