summaryrefslogtreecommitdiffstats
path: root/content/shell
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-04 20:26:15 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-04 20:26:15 +0000
commit96720faa5a0d1aaedfc4d36ffc409c78589cb49a (patch)
treecffba3a479facc5caca4d7bcdae5ec330fda69b8 /content/shell
parent87584663cca816290c803aef2eafb2aee05ce919 (diff)
downloadchromium_src-96720faa5a0d1aaedfc4d36ffc409c78589cb49a.zip
chromium_src-96720faa5a0d1aaedfc4d36ffc409c78589cb49a.tar.gz
chromium_src-96720faa5a0d1aaedfc4d36ffc409c78589cb49a.tar.bz2
Minor cleaning of shell javascript dialogs.
BUG=120155 TEST=no functional change Review URL: https://chromiumcodereview.appspot.com/9961013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r--content/shell/shell_javascript_dialog.h3
-rw-r--r--content/shell/shell_javascript_dialog_mac.mm18
2 files changed, 9 insertions, 12 deletions
diff --git a/content/shell/shell_javascript_dialog.h b/content/shell/shell_javascript_dialog.h
index a64ba39..01e2a5d 100644
--- a/content/shell/shell_javascript_dialog.h
+++ b/content/shell/shell_javascript_dialog.h
@@ -10,10 +10,8 @@
#if defined(OS_MACOSX)
#if __OBJC__
-@class NSAlert;
@class ShellJavaScriptDialogHelper;
#else
-class NSAlert;
class ShellJavaScriptDialogHelper;
#endif // __OBJC__
#endif // defined(OS_MACOSX)
@@ -41,7 +39,6 @@ class ShellJavaScriptDialog {
#if defined(OS_MACOSX)
ShellJavaScriptDialogHelper* helper_; // owned
- NSAlert* alert_; // weak, owned by |helper_|.
#elif defined(OS_WIN)
ui::JavascriptMessageType message_type_;
HWND dialog_win_;
diff --git a/content/shell/shell_javascript_dialog_mac.mm b/content/shell/shell_javascript_dialog_mac.mm
index 543bb55..90ad82e 100644
--- a/content/shell/shell_javascript_dialog_mac.mm
+++ b/content/shell/shell_javascript_dialog_mac.mm
@@ -104,29 +104,29 @@ ShellJavaScriptDialog::ShellJavaScriptDialog(
andCallback:callback];
// Show the modal dialog.
- alert_ = [helper_ alert];
+ NSAlert* alert = [helper_ alert];
NSTextField* field = nil;
if (text_field) {
field = [helper_ textField];
[field setStringValue:base::SysUTF16ToNSString(default_prompt_text)];
}
- [alert_ setDelegate:helper_];
- [alert_ setInformativeText:base::SysUTF16ToNSString(message_text)];
- [alert_ setMessageText:@"Javascript alert"];
- [alert_ addButtonWithTitle:@"OK"];
+ [alert setDelegate:helper_];
+ [alert setInformativeText:base::SysUTF16ToNSString(message_text)];
+ [alert setMessageText:@"Javascript alert"];
+ [alert addButtonWithTitle:@"OK"];
if (!one_button) {
- NSButton* other = [alert_ addButtonWithTitle:@"Cancel"];
+ NSButton* other = [alert addButtonWithTitle:@"Cancel"];
[other setKeyEquivalent:@"\e"];
}
- [alert_
+ [alert
beginSheetModalForWindow:nil // nil here makes it app-modal
modalDelegate:helper_
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
contextInfo:this];
- if ([alert_ accessoryView])
- [[alert_ window] makeFirstResponder:[alert_ accessoryView]];
+ if ([alert accessoryView])
+ [[alert window] makeFirstResponder:[alert accessoryView]];
}
ShellJavaScriptDialog::~ShellJavaScriptDialog() {