Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: chrome/browser/ui/cocoa/web_dialog_window_controller.h

Issue 10214001: WebDialogs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_HTML_DIALOG_WINDOW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_WEB_DIALOG_WINDOW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_HTML_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 "chrome/browser/ui/webui/html_dialog_ui.h" 14 #include "chrome/browser/ui/webui/web_dialog_ui.h"
15 15
16 class Browser; 16 class Browser;
17 class HtmlDialogWindowDelegateBridge; 17 class WebDialogWindowDelegateBridge;
18 class Profile; 18 class Profile;
19 class TabContentsWrapper; 19 class TabContentsWrapper;
20 20
21 // 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
22 // from a HTMLDialogUIDelegate object. 22 // from a WebDialogDelegate object.
23 @interface HtmlDialogWindowController : NSWindowController<NSWindowDelegate> { 23 @interface WebDialogWindowController : NSWindowController<NSWindowDelegate> {
24 @private 24 @private
25 // Order here is important, as tab_contents_ may send messages to 25 // Order here is important, as tab_contents_ may send messages to
26 // delegate_ when it gets destroyed. 26 // delegate_ when it gets destroyed.
27 scoped_ptr<HtmlDialogWindowDelegateBridge> delegate_; 27 scoped_ptr<WebDialogWindowDelegateBridge> delegate_;
28 scoped_ptr<TabContentsWrapper> contentsWrapper_; 28 scoped_ptr<TabContentsWrapper> contentsWrapper_;
29 } 29 }
30 30
31 // Creates and shows an HtmlDialogWindowController with the given 31 // Creates and shows an WebDialogWindowController with the given
32 // delegate and profile whose lifetime is controlled by the given 32 // delegate and profile whose lifetime is controlled by the given
33 // browser. The window is automatically destroyed when it, or its 33 // browser. The window is automatically destroyed when it, or its
34 // controlling browser is closed. Returns the created window. 34 // controlling browser is closed. Returns the created window.
35 // 35 //
36 // 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
37 // 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.
38 + (NSWindow*)showHtmlDialog:(HtmlDialogUIDelegate*)delegate 38 + (NSWindow*)showWebDialog:(WebDialogDelegate*)delegate
39 profile:(Profile*)profile 39 profile:(Profile*)profile
40 browser:(Browser*)browser; 40 browser:(Browser*)browser;
41 41
42 @end 42 @end
43 43
44 @interface HtmlDialogWindowController (TestingAPI) 44 @interface WebDialogWindowController (TestingAPI)
45 45
46 // This is the designated initializer. However, this is exposed only 46 // This is the designated initializer. However, this is exposed only
47 // for testing; use showHtmlDialog instead. 47 // for testing; use showWebDialog instead.
48 - (id)initWithDelegate:(HtmlDialogUIDelegate*)delegate 48 - (id)initWithDelegate:(WebDialogDelegate*)delegate
49 profile:(Profile*)profile 49 profile:(Profile*)profile
50 browser:(Browser*)browser; 50 browser:(Browser*)browser;
51 51
52 // 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
53 // 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
54 // called before showWindow. 54 // called before showWindow.
55 - (void)loadDialogContents; 55 - (void)loadDialogContents;
56 56
57 @end 57 @end
58 58
59 #endif // CHROME_BROWSER_UI_COCOA_HTML_DIALOG_WINDOW_CONTROLLER_H_ 59 #endif // CHROME_BROWSER_UI_COCOA_WEB_DIALOG_WINDOW_CONTROLLER_H_
60 60
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698