| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 5 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // Clear the key equivalent (currently 'Return') because cancel is the default | 52 // Clear the key equivalent (currently 'Return') because cancel is the default |
| 53 // button. | 53 // button. |
| 54 [continueButton setKeyEquivalent:@""]; | 54 [continueButton setKeyEquivalent:@""]; |
| 55 | 55 |
| 56 NSButton* cancelButton = [alert addButtonWithTitle:l10n_util::GetNSString( | 56 NSButton* cancelButton = [alert addButtonWithTitle:l10n_util::GetNSString( |
| 57 IDS_CANCEL)]; | 57 IDS_CANCEL)]; |
| 58 [cancelButton setKeyEquivalent:@"\r"]; | 58 [cancelButton setKeyEquivalent:@"\r"]; |
| 59 | 59 |
| 60 [alert setMessageText:l10n_util::GetNSStringF( | 60 [alert setMessageText:l10n_util::GetNSStringF( |
| 61 IDS_EXTENSION_UNINSTALL_PROMPT_HEADING, | 61 IDS_EXTENSION_UNINSTALL_PROMPT_HEADING, |
| 62 UTF8ToUTF16(extension_->name()))]; | 62 base::UTF8ToUTF16(extension_->name()))]; |
| 63 [alert setAlertStyle:NSWarningAlertStyle]; | 63 [alert setAlertStyle:NSWarningAlertStyle]; |
| 64 [alert setIcon:gfx::NSImageFromImageSkia(icon_)]; | 64 [alert setIcon:gfx::NSImageFromImageSkia(icon_)]; |
| 65 | 65 |
| 66 if ([alert runModal] == NSAlertFirstButtonReturn) | 66 if ([alert runModal] == NSAlertFirstButtonReturn) |
| 67 delegate_->ExtensionUninstallAccepted(); | 67 delegate_->ExtensionUninstallAccepted(); |
| 68 else | 68 else |
| 69 delegate_->ExtensionUninstallCanceled(); | 69 delegate_->ExtensionUninstallCanceled(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace | 72 } // namespace |
| 73 | 73 |
| 74 // static | 74 // static |
| 75 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( | 75 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( |
| 76 Profile* profile, | 76 Profile* profile, |
| 77 Browser* browser, | 77 Browser* browser, |
| 78 Delegate* delegate) { | 78 Delegate* delegate) { |
| 79 return new ExtensionUninstallDialogCocoa(profile, browser, delegate); | 79 return new ExtensionUninstallDialogCocoa(profile, browser, delegate); |
| 80 } | 80 } |
| OLD | NEW |