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_2_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_2_ |
6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_2_ | 6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_2_ |
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" |
11 #include "chrome/browser/ui/constrained_window.h" | 11 #include "chrome/browser/ui/constrained_window.h" |
12 | 12 |
13 class TabContents; | 13 namespace content { |
| 14 class WebContents; |
| 15 } |
14 | 16 |
15 // Constrained window implementation for Mac. | 17 // Constrained window implementation for Mac. |
16 class ConstrainedWindowMac2 : public ConstrainedWindow { | 18 class ConstrainedWindowMac2 : public ConstrainedWindow { |
17 public: | 19 public: |
18 ConstrainedWindowMac2(TabContents* tab_contents, NSWindow* window); | 20 ConstrainedWindowMac2(content::WebContents* web_contents, NSWindow* window); |
19 | 21 |
20 // ConstrainedWindow implementation. | 22 // ConstrainedWindow implementation. |
21 virtual void ShowConstrainedWindow() OVERRIDE; | 23 virtual void ShowConstrainedWindow() OVERRIDE; |
22 // Closes the constrained window and deletes this instance. | 24 // Closes the constrained window and deletes this instance. |
23 virtual void CloseConstrainedWindow() OVERRIDE; | 25 virtual void CloseConstrainedWindow() OVERRIDE; |
24 virtual void PulseConstrainedWindow() OVERRIDE; | 26 virtual void PulseConstrainedWindow() OVERRIDE; |
25 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; | 27 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; |
26 virtual bool CanShowConstrainedWindow() OVERRIDE; | 28 virtual bool CanShowConstrainedWindow() OVERRIDE; |
27 | 29 |
28 private: | 30 private: |
29 virtual ~ConstrainedWindowMac2(); | 31 virtual ~ConstrainedWindowMac2(); |
30 | 32 |
31 // Gets the parent window of the dialog. | 33 // Gets the parent window of the dialog. |
32 NSWindow* GetParentWindow() const; | 34 NSWindow* GetParentWindow() const; |
33 | 35 |
34 TabContents* tab_contents_; // weak | 36 // The WebContents that owns and constrains this ConstrainedWindow. Weak. |
| 37 content::WebContents* web_contents_; |
| 38 |
35 scoped_nsobject<NSWindow> window_; | 39 scoped_nsobject<NSWindow> window_; |
36 }; | 40 }; |
37 | 41 |
38 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_2_ | 42 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_2_ |
OLD | NEW |