OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ |
6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ | 6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 content::WebContents* web_contents, | 36 content::WebContents* web_contents, |
37 id<ConstrainedWindowSheet> sheet); | 37 id<ConstrainedWindowSheet> sheet); |
38 virtual ~ConstrainedWindowMac(); | 38 virtual ~ConstrainedWindowMac(); |
39 | 39 |
40 // WebContentsModalDialog implementation. | 40 // WebContentsModalDialog implementation. |
41 virtual void ShowWebContentsModalDialog() OVERRIDE; | 41 virtual void ShowWebContentsModalDialog() OVERRIDE; |
42 // Closes the constrained window and deletes this instance. | 42 // Closes the constrained window and deletes this instance. |
43 virtual void CloseWebContentsModalDialog() OVERRIDE; | 43 virtual void CloseWebContentsModalDialog() OVERRIDE; |
44 virtual void FocusWebContentsModalDialog() OVERRIDE; | 44 virtual void FocusWebContentsModalDialog() OVERRIDE; |
45 virtual void PulseWebContentsModalDialog() OVERRIDE; | 45 virtual void PulseWebContentsModalDialog() OVERRIDE; |
46 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; | 46 virtual gfx::NativeView GetNativeView() OVERRIDE; |
47 | 47 |
48 // content::NotificationObserver: | 48 // content::NotificationObserver: |
49 virtual void Observe(int type, | 49 virtual void Observe(int type, |
50 const content::NotificationSource& source, | 50 const content::NotificationSource& source, |
51 const content::NotificationDetails& details) OVERRIDE; | 51 const content::NotificationDetails& details) OVERRIDE; |
52 | 52 |
53 private: | 53 private: |
54 // Gets the parent window of the dialog. | 54 // Gets the parent window of the dialog. |
55 NSWindow* GetParentWindow() const; | 55 NSWindow* GetParentWindow() const; |
56 | 56 |
57 ConstrainedWindowMacDelegate* delegate_; // weak, owns us. | 57 ConstrainedWindowMacDelegate* delegate_; // weak, owns us. |
58 | 58 |
59 // The WebContents that owns and constrains this WebContentsModalDialog. Weak. | 59 // The WebContents that owns and constrains this WebContentsModalDialog. Weak. |
60 content::WebContents* web_contents_; | 60 content::WebContents* web_contents_; |
61 | 61 |
62 scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_; | 62 scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_; |
63 | 63 |
| 64 scoped_nsobject<NSView> dummyView_; |
| 65 |
64 // A scoped container for notification registries. | 66 // A scoped container for notification registries. |
65 content::NotificationRegistrar registrar_; | 67 content::NotificationRegistrar registrar_; |
66 | 68 |
67 // This is true if the constrained window is waiting to be shown. | 69 // This is true if the constrained window is waiting to be shown. |
68 bool pending_show_; | 70 bool pending_show_; |
69 }; | 71 }; |
70 | 72 |
71 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ | 73 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ |
OLD | NEW |