summaryrefslogtreecommitdiffstats
path: root/chrome/browser/alternate_nav_url_fetcher.h
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-16 21:00:48 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-16 21:00:48 +0000
commit447c79c28fa36d23081359920e45c810eca94dfe (patch)
treece29d19af3d2a745019ee9f10e387c27e1860936 /chrome/browser/alternate_nav_url_fetcher.h
parente57d57f04228aee2cfe96a598669f8e0b1662f09 (diff)
downloadchromium_src-447c79c28fa36d23081359920e45c810eca94dfe.zip
chromium_src-447c79c28fa36d23081359920e45c810eca94dfe.tar.gz
chromium_src-447c79c28fa36d23081359920e45c810eca94dfe.tar.bz2
Remove the rest of the alternate nav url fetcher from the navigation controller.
This changes the memory model around a bit, and it's not the most clear thing ever, not that it was before. The alternate URL fetcher is now responsible for deleting itself in most cases. BUG=2370 (Assertion when using the alternate URL tracker twice in a row) BUG=1324500 (Move the AlternateNavURLFetcher logic out of NavigationController) Review URL: http://codereview.chromium.org/2905 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2279 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/alternate_nav_url_fetcher.h')
-rw-r--r--chrome/browser/alternate_nav_url_fetcher.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.h b/chrome/browser/alternate_nav_url_fetcher.h
index 94833a4..b28b48f0 100644
--- a/chrome/browser/alternate_nav_url_fetcher.h
+++ b/chrome/browser/alternate_nav_url_fetcher.h
@@ -18,6 +18,13 @@ class NavigationController;
// tell if the entry was a search or an intranet hostname. The autocomplete bar
// assumes it's a query and issues an AlternateNavURLFetcher to display a "did
// you mean" infobar suggesting a navigation.
+//
+// The memory management of this object is a bit tricky. The location bar view
+// will create us and be responsible for us until we attach as an observer
+// after a pending load starts (it will delete us if this doesn't happen).
+// Once this pending load starts, we're responsible for deleting ourselves.
+// We'll do this when the load commits, or when the navigation controller
+// itself is deleted.
class AlternateNavURLFetcher : public NotificationObserver,
public URLFetcher::Delegate {
public:
@@ -29,7 +36,6 @@ class AlternateNavURLFetcher : public NotificationObserver,
};
explicit AlternateNavURLFetcher(const std::wstring& alternate_nav_url);
- virtual ~AlternateNavURLFetcher();
State state() const { return state_; }
@@ -48,7 +54,8 @@ class AlternateNavURLFetcher : public NotificationObserver,
private:
// Displays the infobar if all conditions are met (the page has loaded and
- // the fetch of the alternate URL succeeded).
+ // the fetch of the alternate URL succeeded). If the infobar is displayed,
+ // this object is no longer necessary and this function WILL DELETE |this|!.
void ShowInfobarIfPossible();
std::wstring alternate_nav_url_;