Index: chrome/browser/ui/views/external_protocol_dialog.cc |
diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc |
index 3405c5cb40a9b1940e5f872dd57be4bac45b3624..a7ae8af2b54f0519e5d61deea7ffe9c609200b4e 100644 |
--- a/chrome/browser/ui/views/external_protocol_dialog.cc |
+++ b/chrome/browser/ui/views/external_protocol_dialog.cc |
@@ -156,13 +156,10 @@ ExternalProtocolDialog::ExternalProtocolDialog(WebContents* web_contents, |
l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT)); |
// Dialog is top level if we don't have a web_contents associated with us. |
- HWND root_hwnd = NULL; |
- if (web_contents_) { |
- root_hwnd = GetAncestor(web_contents_->GetView()->GetContentNativeView(), |
- GA_ROOT); |
- } |
- |
- CreateBrowserModalDialogViews(this, root_hwnd)->Show(); |
+ gfx::NativeWindow parent_window = NULL; |
+ if (web_contents_) |
+ parent_window = web_contents_->GetView()->GetTopLevelNativeWindow(); |
+ CreateBrowserModalDialogViews(this, parent_window)->Show(); |
} |
// static |