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

Unified Diff: chrome/browser/ui/startup/session_crashed_prompt.cc

Issue 11740035: Don't access owner() in the constructor; eventually doing this won't work, because InfoBarDelegates… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 12 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/startup/session_crashed_prompt.cc
===================================================================
--- chrome/browser/ui/startup/session_crashed_prompt.cc (revision 175045)
+++ chrome/browser/ui/startup/session_crashed_prompt.cc (working copy)
@@ -30,7 +30,8 @@
class SessionCrashedInfoBarDelegate : public ConfirmInfoBarDelegate,
public content::NotificationObserver {
public:
- explicit SessionCrashedInfoBarDelegate(InfoBarService* infobar_service);
+ SessionCrashedInfoBarDelegate(InfoBarService* infobar_service,
+ Browser* browser);
private:
virtual ~SessionCrashedInfoBarDelegate();
@@ -56,11 +57,12 @@
};
SessionCrashedInfoBarDelegate::SessionCrashedInfoBarDelegate(
- InfoBarService* infobar_service)
+ InfoBarService* infobar_service,
+ Browser* browser)
: ConfirmInfoBarDelegate(infobar_service),
accepted_(false),
removed_notification_received_(false),
- browser_(chrome::FindBrowserWithWebContents(owner()->GetWebContents())) {
+ browser_(browser) {
// TODO(pkasting,marja): Once InfoBars own they delegates, this is not needed
// any more. Then we can rely on delegates getting destroyed, and we can
// initiate the session storage scavenging only in the destructor. (Currently,
@@ -150,7 +152,7 @@
return;
infobar_service->AddInfoBar(
- new SessionCrashedInfoBarDelegate(infobar_service));
+ new SessionCrashedInfoBarDelegate(infobar_service, browser));
}
} // namespace chrome
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698