| Index: chrome/browser/ui/cocoa/single_web_contents_dialog_manager_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/single_web_contents_dialog_manager_cocoa.mm b/chrome/browser/ui/cocoa/single_web_contents_dialog_manager_cocoa.mm
|
| index 23c5c446165296633a6edd1510be0d48455fd8c6..b0ab8b7cffb04a5f87310f004e8944984bb36d0b 100644
|
| --- a/chrome/browser/ui/cocoa/single_web_contents_dialog_manager_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/single_web_contents_dialog_manager_cocoa.mm
|
| @@ -45,6 +45,7 @@ void SingleWebContentsDialogManagerCocoa::Show() {
|
|
|
| [[ConstrainedWindowSheetController controllerForParentWindow:parent_window]
|
| showSheet:sheet_ forParentView:parent_view];
|
| + dialog();
|
| }
|
|
|
| void SingleWebContentsDialogManagerCocoa::Hide() {
|
| @@ -83,5 +84,8 @@ void SingleWebContentsDialogManagerCocoa::HostChanged(
|
| }
|
|
|
| gfx::NativeWindow SingleWebContentsDialogManagerCocoa::dialog() {
|
| - return [sheet_ sheetWindow];
|
| + // Update |dialog_| if unpopulated or if the sheetWindow has changed.
|
| + if (!dialog_ || ([sheet_ sheetWindow] && dialog_ != [sheet_ sheetWindow]))
|
| + dialog_ = [sheet_ sheetWindow];
|
| + return dialog_;
|
| }
|
|
|