| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/single_web_contents_dialog_manager_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/single_web_contents_dialog_manager_cocoa.h" |
| 6 | 6 |
| 7 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh
eet.h" | 7 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh
eet.h" |
| 8 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" | 8 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" |
| 9 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con
troller.h" | 9 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con
troller.h" |
| 10 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 10 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 11 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 11 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 12 | 12 |
| 13 using web_modal::NativeWebContentsModalDialog; | |
| 14 using web_modal::SingleWebContentsDialogManagerDelegate; | 13 using web_modal::SingleWebContentsDialogManagerDelegate; |
| 15 | 14 |
| 16 SingleWebContentsDialogManagerCocoa::SingleWebContentsDialogManagerCocoa( | 15 SingleWebContentsDialogManagerCocoa::SingleWebContentsDialogManagerCocoa( |
| 17 ConstrainedWindowMac* client, | 16 ConstrainedWindowMac* client, |
| 18 id<ConstrainedWindowSheet> sheet, | 17 id<ConstrainedWindowSheet> sheet, |
| 19 web_modal::SingleWebContentsDialogManagerDelegate* delegate) | 18 web_modal::SingleWebContentsDialogManagerDelegate* delegate) |
| 20 : client_(client), | 19 : client_(client), |
| 21 sheet_([sheet retain]), | 20 sheet_([sheet retain]), |
| 22 delegate_(delegate), | 21 delegate_(delegate), |
| 23 shown_(false) { | 22 shown_(false) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 61 |
| 63 void SingleWebContentsDialogManagerCocoa::Pulse() { | 62 void SingleWebContentsDialogManagerCocoa::Pulse() { |
| 64 [[ConstrainedWindowSheetController controllerForSheet:sheet_] | 63 [[ConstrainedWindowSheetController controllerForSheet:sheet_] |
| 65 pulseSheet:sheet_]; | 64 pulseSheet:sheet_]; |
| 66 } | 65 } |
| 67 | 66 |
| 68 void SingleWebContentsDialogManagerCocoa::HostChanged( | 67 void SingleWebContentsDialogManagerCocoa::HostChanged( |
| 69 web_modal::WebContentsModalDialogHost* new_host) { | 68 web_modal::WebContentsModalDialogHost* new_host) { |
| 70 } | 69 } |
| 71 | 70 |
| 72 NativeWebContentsModalDialog SingleWebContentsDialogManagerCocoa::dialog() { | 71 gfx::NativeWindow SingleWebContentsDialogManagerCocoa::dialog() { |
| 73 return [sheet_ sheetWindow]; | 72 return [sheet_ sheetWindow]; |
| 74 } | 73 } |
| 75 | 74 |
| 76 namespace web_modal { | 75 namespace web_modal { |
| 77 | 76 |
| 78 SingleWebContentsDialogManager* | 77 SingleWebContentsDialogManager* |
| 79 WebContentsModalDialogManager::CreateNativeWebModalManager( | 78 WebContentsModalDialogManager::CreateNativeWebModalManager( |
| 80 NativeWebContentsModalDialog dialog, | 79 gfx::NativeWindow dialog, |
| 81 SingleWebContentsDialogManagerDelegate* delegate) { | 80 SingleWebContentsDialogManagerDelegate* delegate) { |
| 82 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( | 81 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( |
| 83 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:dialog]); | 82 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:dialog]); |
| 84 return new SingleWebContentsDialogManagerCocoa(nullptr, sheet, delegate); | 83 return new SingleWebContentsDialogManagerCocoa(nullptr, sheet, delegate); |
| 85 } | 84 } |
| 86 | 85 |
| 87 } // namespace web_modal | 86 } // namespace web_modal |
| OLD | NEW |