summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/jsmessage_box_handler_win.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/jsmessage_box_handler_win.cc b/chrome/browser/jsmessage_box_handler_win.cc
index 847f7cf..5184dd6 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;