diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-18 18:09:36 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-18 18:09:36 +0000 |
commit | 59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919 (patch) | |
tree | da55718682e3a4d7da3c6f3d70870eee0542d0b9 /chrome/browser/find_bar_controller.cc | |
parent | d940627c90386df7844092dae635ed2f20535f28 (diff) | |
download | chromium_src-59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919.zip chromium_src-59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919.tar.gz chromium_src-59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919.tar.bz2 |
Fix the ownership model of TabContents and NavigationController. Previously the
NavigationController owned the TabContents, and there were extra steps required
at creation and destruction to clean everything up properly.
NavigationController is now a member of TabContents, and there is no setup or
tear down necessary other than the constructor and destructor. I could remove
the tab contents creation in the NavigationController, as well as all the
weird destruction code in WebContents which got moved to the destructor.
I made the controller getter return a reference since the ownership is clear
and there is no possibility of NULL. This required changing a lot of tiles, but
many of them were simplified since they no longer have to NULL check.
Review URL: http://codereview.chromium.org/69043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/find_bar_controller.cc')
-rw-r--r-- | chrome/browser/find_bar_controller.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/find_bar_controller.cc b/chrome/browser/find_bar_controller.cc index bdcb94b..fb5cf3b 100644 --- a/chrome/browser/find_bar_controller.cc +++ b/chrome/browser/find_bar_controller.cc @@ -55,7 +55,7 @@ void FindBarController::ChangeWebContents(WebContents* contents) { Source<TabContents>(web_contents_)); NotificationService::current()->RemoveObserver( this, NotificationType::NAV_ENTRY_COMMITTED, - Source<NavigationController>(web_contents_->controller())); + Source<NavigationController>(&web_contents_->controller())); find_bar_->StopAnimation(); } @@ -74,7 +74,7 @@ void FindBarController::ChangeWebContents(WebContents* contents) { Source<TabContents>(web_contents_)); NotificationService::current()->AddObserver( this, NotificationType::NAV_ENTRY_COMMITTED, - Source<NavigationController>(web_contents_->controller())); + Source<NavigationController>(&web_contents_->controller())); // Find out what we should show in the find text box. Usually, this will be // the last search in this tab, but if no search has been issued in this tab @@ -125,7 +125,7 @@ void FindBarController::Observe(NotificationType type, } else if (type == NotificationType::NAV_ENTRY_COMMITTED) { NavigationController* source_controller = Source<NavigationController>(source).ptr(); - if (source_controller == web_contents_->controller()) { + if (source_controller == &web_contents_->controller()) { NavigationController::LoadCommittedDetails* commit_details = Details<NavigationController::LoadCommittedDetails>(details).ptr(); PageTransition::Type transition_type = |