summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 22:16:00 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 22:16:00 +0000
commit4d4e4af1cc0f3cfc483e2d90c00f99dccf27071d (patch)
treec73a18d8b253069f2f09bf07afae3f9360911e30 /chrome/browser/cocoa
parent9d7a5dded02f75bbf4dce8857d871d8d18d9c9ac (diff)
downloadchromium_src-4d4e4af1cc0f3cfc483e2d90c00f99dccf27071d.zip
chromium_src-4d4e4af1cc0f3cfc483e2d90c00f99dccf27071d.tar.gz
chromium_src-4d4e4af1cc0f3cfc483e2d90c00f99dccf27071d.tar.bz2
Integrated customize sync dialog with sync setup wizard on OS X.
Changed ShowHtmlDialog() on OS X to return the created window. BUG=34209 TEST=manual Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=43796 Review URL: http://codereview.chromium.org/1535018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43886 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/html_dialog_window_controller.h11
-rw-r--r--chrome/browser/cocoa/html_dialog_window_controller.mm10
-rw-r--r--chrome/browser/cocoa/html_dialog_window_controller_cppsafe.h10
3 files changed, 21 insertions, 10 deletions
diff --git a/chrome/browser/cocoa/html_dialog_window_controller.h b/chrome/browser/cocoa/html_dialog_window_controller.h
index c8e3884..9c871b1 100644
--- a/chrome/browser/cocoa/html_dialog_window_controller.h
+++ b/chrome/browser/cocoa/html_dialog_window_controller.h
@@ -29,10 +29,13 @@ class TabContents;
}
// Creates and shows an HtmlDialogWindowController with the given
-// delegate and profile. The window is automatically destroyed when it is
-// closed.
-+ (void)showHtmlDialog:(HtmlDialogUIDelegate*)delegate
- profile:(Profile*)profile;
+// delegate and profile. The window is automatically destroyed when
+// it is closed. Returns the created window.
+//
+// Make sure to use the returned window only when you know it is safe
+// to do so, i.e. before OnDialogClosed() is called on the delegate.
++ (NSWindow*)showHtmlDialog:(HtmlDialogUIDelegate*)delegate
+ profile:(Profile*)profile;
@end
diff --git a/chrome/browser/cocoa/html_dialog_window_controller.mm b/chrome/browser/cocoa/html_dialog_window_controller.mm
index f2b79ea..32b2096 100644
--- a/chrome/browser/cocoa/html_dialog_window_controller.mm
+++ b/chrome/browser/cocoa/html_dialog_window_controller.mm
@@ -72,8 +72,9 @@ private:
namespace html_dialog_window_controller {
-void ShowHtmlDialog(HtmlDialogUIDelegate* delegate, Profile* profile) {
- [HtmlDialogWindowController showHtmlDialog:delegate profile:profile];
+gfx::NativeWindow ShowHtmlDialog(
+ HtmlDialogUIDelegate* delegate, Profile* profile) {
+ return [HtmlDialogWindowController showHtmlDialog:delegate profile:profile];
}
} // namespace html_dialog_window_controller
@@ -217,13 +218,14 @@ void HtmlDialogWindowDelegateBridge::HandleKeyboardEvent(
// NOTE(akalin): We'll probably have to add the parentWindow parameter back
// in once we implement modal dialogs.
-+ (void)showHtmlDialog:(HtmlDialogUIDelegate*)delegate
- profile:(Profile*)profile {
++ (NSWindow*)showHtmlDialog:(HtmlDialogUIDelegate*)delegate
+ profile:(Profile*)profile {
HtmlDialogWindowController* htmlDialogWindowController =
[[HtmlDialogWindowController alloc] initWithDelegate:delegate
profile:profile];
[htmlDialogWindowController loadDialogContents];
[htmlDialogWindowController showWindow:nil];
+ return [htmlDialogWindowController window];
}
- (id)initWithDelegate:(HtmlDialogUIDelegate*)delegate
diff --git a/chrome/browser/cocoa/html_dialog_window_controller_cppsafe.h b/chrome/browser/cocoa/html_dialog_window_controller_cppsafe.h
index 15c4576..9bcd975 100644
--- a/chrome/browser/cocoa/html_dialog_window_controller_cppsafe.h
+++ b/chrome/browser/cocoa/html_dialog_window_controller_cppsafe.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_COCOA_HTML_DIALOG_WINDOW_CONTROLLER_CPPSAFE_H_
#define CHROME_BROWSER_COCOA_HTML_DIALOG_WINDOW_CONTROLLER_CPPSAFE_H_
+#include "gfx/native_widget_types.h"
+
// We declare this in a separate file that is safe for including in C++ code.
// TODO(akalin): It would be nice if there were a platform-agnostic way to
@@ -16,8 +18,12 @@ namespace html_dialog_window_controller {
// Creates and shows an HtmlDialogWindowController with the given
// delegate and profile. The window is automatically destroyed when it is
-// closed.
-void ShowHtmlDialog(HtmlDialogUIDelegate* delegate, Profile* profile);
+// closed. Returns the created window.
+//
+// Make sure to use the returned window only when you know it is safe
+// to do so, i.e. before OnDialogClosed() is called on the delegate.
+gfx::NativeWindow ShowHtmlDialog(
+ HtmlDialogUIDelegate* delegate, Profile* profile);
} // namespace html_dialog_window_controller