| 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_WEB_DIALOG_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_WEB_DIALOG_WINDOW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_WEB_DIALOG_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_WEB_DIALOG_WINDOW_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #import "base/mac/cocoa_protocols.h" | 12 #import "base/mac/cocoa_protocols.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "ui/web_dialogs/web_dialog_ui.h" | 14 #include "ui/web_dialogs/web_dialog_ui.h" |
| 15 | 15 |
| 16 class Browser; | 16 class Browser; |
| 17 class WebDialogWindowDelegateBridge; | 17 class WebDialogWindowDelegateBridge; |
| 18 class Profile; | 18 class Profile; |
| 19 class TabContents; | 19 class TabContents; |
| 20 typedef TabContents TabContentsWrapper; | |
| 21 | 20 |
| 22 // This controller manages a dialog box with properties and HTML content taken | 21 // This controller manages a dialog box with properties and HTML content taken |
| 23 // from a WebDialogDelegate object. | 22 // from a WebDialogDelegate object. |
| 24 @interface WebDialogWindowController : NSWindowController<NSWindowDelegate> { | 23 @interface WebDialogWindowController : NSWindowController<NSWindowDelegate> { |
| 25 @private | 24 @private |
| 26 // Order here is important, as tab_contents_ may send messages to | 25 // Order here is important, as tabContents_ may send messages to |
| 27 // delegate_ when it gets destroyed. | 26 // delegate_ when it gets destroyed. |
| 28 scoped_ptr<WebDialogWindowDelegateBridge> delegate_; | 27 scoped_ptr<WebDialogWindowDelegateBridge> delegate_; |
| 29 scoped_ptr<TabContentsWrapper> contentsWrapper_; | 28 scoped_ptr<TabContents> tabContents_; |
| 30 } | 29 } |
| 31 | 30 |
| 32 // Creates and shows an WebDialogWindowController with the given | 31 // Creates and shows an WebDialogWindowController with the given |
| 33 // delegate and profile whose lifetime is controlled by the given | 32 // delegate and profile whose lifetime is controlled by the given |
| 34 // browser. The window is automatically destroyed when it, or its | 33 // browser. The window is automatically destroyed when it, or its |
| 35 // controlling browser is closed. Returns the created window. | 34 // controlling browser is closed. Returns the created window. |
| 36 // | 35 // |
| 37 // Make sure to use the returned window only when you know it is safe | 36 // Make sure to use the returned window only when you know it is safe |
| 38 // to do so, i.e. before OnDialogClosed() is called on the delegate. | 37 // to do so, i.e. before OnDialogClosed() is called on the delegate. |
| 39 + (NSWindow*)showWebDialog:(ui::WebDialogDelegate*)delegate | 38 + (NSWindow*)showWebDialog:(ui::WebDialogDelegate*)delegate |
| (...skipping 11 matching lines...) Expand all Loading... |
| 51 browser:(Browser*)browser; | 50 browser:(Browser*)browser; |
| 52 | 51 |
| 53 // Loads the HTML content from the delegate; this is not a lightweight | 52 // Loads the HTML content from the delegate; this is not a lightweight |
| 54 // process which is why it is not part of the constructor. Must be | 53 // process which is why it is not part of the constructor. Must be |
| 55 // called before showWindow. | 54 // called before showWindow. |
| 56 - (void)loadDialogContents; | 55 - (void)loadDialogContents; |
| 57 | 56 |
| 58 @end | 57 @end |
| 59 | 58 |
| 60 #endif // CHROME_BROWSER_UI_COCOA_WEB_DIALOG_WINDOW_CONTROLLER_H_ | 59 #endif // CHROME_BROWSER_UI_COCOA_WEB_DIALOG_WINDOW_CONTROLLER_H_ |
| OLD | NEW |