| Index: chrome/browser/jsmessage_box_handler_win.cc
|
| diff --git a/chrome/browser/jsmessage_box_handler_win.cc b/chrome/browser/jsmessage_box_handler_win.cc
|
| index 847f7cfd4909b6a1f85258a68b9f1080a615b371..5184dd6ccc4895bc7fb315e0a887a5801795481b 100644
|
| --- a/chrome/browser/jsmessage_box_handler_win.cc
|
| +++ b/chrome/browser/jsmessage_box_handler_win.cc
|
| @@ -84,7 +84,7 @@ int JavascriptMessageBoxHandler::GetDialogButtons() const {
|
| }
|
|
|
| std::wstring JavascriptMessageBoxHandler::GetWindowTitle() const {
|
| - if (!frame_url_.has_host())
|
| + if (!frame_url_.has_host() || !web_contents_)
|
| return l10n_util::GetString(IDS_JAVASCRIPT_MESSAGEBOX_DEFAULT_TITLE);
|
|
|
| // We really only want the scheme, hostname, and port.
|
| @@ -189,10 +189,11 @@ views::View* JavascriptMessageBoxHandler::GetInitiallyFocusedView() {
|
| void JavascriptMessageBoxHandler::Observe(NotificationType type,
|
| const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| - bool web_contents_gone = false;
|
| if (!web_contents_)
|
| return;
|
|
|
| + bool web_contents_gone = false;
|
| +
|
| if (type == NotificationType::NAV_ENTRY_COMMITTED &&
|
| Source<NavigationController>(source).ptr() == web_contents_->controller())
|
| web_contents_gone = true;
|
|
|