| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "components/constrained_window/native_web_contents_modal_dialog_manager
_views_mac.h" | 5 #include "components/constrained_window/native_web_contents_modal_dialog_manager
_views_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "components/constrained_window/constrained_window_views.h" | 9 #include "components/constrained_window/constrained_window_views.h" |
| 10 #include "components/guest_view/browser/guest_view_base.h" | 10 #include "components/guest_view/browser/guest_view_base.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 namespace constrained_window { | 36 namespace constrained_window { |
| 37 | 37 |
| 38 NativeWebContentsModalDialogManagerViewsMac:: | 38 NativeWebContentsModalDialogManagerViewsMac:: |
| 39 NativeWebContentsModalDialogManagerViewsMac( | 39 NativeWebContentsModalDialogManagerViewsMac( |
| 40 gfx::NativeWindow dialog, | 40 gfx::NativeWindow dialog, |
| 41 web_modal::SingleWebContentsDialogManagerDelegate* native_delegate) | 41 web_modal::SingleWebContentsDialogManagerDelegate* native_delegate) |
| 42 : NativeWebContentsModalDialogManagerViews(dialog, native_delegate) {} | 42 : NativeWebContentsModalDialogManagerViews(dialog, native_delegate, |
| 43 false, NULL) {} |
| 43 | 44 |
| 44 // NativeWebContentsModalDialogManagerViews: | 45 // NativeWebContentsModalDialogManagerViews: |
| 45 void NativeWebContentsModalDialogManagerViewsMac::OnPositionRequiresUpdate() { | 46 void NativeWebContentsModalDialogManagerViewsMac::OnPositionRequiresUpdate() { |
| 46 NativeWebContentsModalDialogManagerViews::OnPositionRequiresUpdate(); | 47 NativeWebContentsModalDialogManagerViews::OnPositionRequiresUpdate(); |
| 47 | 48 |
| 48 views::Widget* widget = GetWidget(dialog()); | 49 views::Widget* widget = GetWidget(dialog()); |
| 49 // Because the animation of SFCertificatePanel will change depending on the | 50 // Because the animation of SFCertificatePanel will change depending on the |
| 50 // size of the parent, i.e. |widget|, make sure its size is the same as the | 51 // size of the parent, i.e. |widget|, make sure its size is the same as the |
| 51 // area under the Chrome UI. The origin of the dialog then also needs to be | 52 // area under the Chrome UI. The origin of the dialog then also needs to be |
| 52 // updated to position the certificate viewer in the middle horizontally. | 53 // updated to position the certificate viewer in the middle horizontally. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void NativeWebContentsModalDialogManagerViewsMac::HideWidget( | 90 void NativeWebContentsModalDialogManagerViewsMac::HideWidget( |
| 90 views::Widget* widget) { | 91 views::Widget* widget) { |
| 91 NSWindow* dialog_window = widget->GetNativeWindow(); | 92 NSWindow* dialog_window = widget->GetNativeWindow(); |
| 92 // Avoid views::Widget::Hide(), as a call to orderOut: on a NSWindow with an | 93 // Avoid views::Widget::Hide(), as a call to orderOut: on a NSWindow with an |
| 93 // attached sheet will close the sheet. Instead, just set the sheet to 0 | 94 // attached sheet will close the sheet. Instead, just set the sheet to 0 |
| 94 // opacity and don't accept click events. | 95 // opacity and don't accept click events. |
| 95 SetSheetVisible(dialog_window, false); | 96 SetSheetVisible(dialog_window, false); |
| 96 } | 97 } |
| 97 | 98 |
| 98 } // namespace constrained_window | 99 } // namespace constrained_window |
| OLD | NEW |