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 #import "chrome/browser/ui/cocoa/restart_browser.h" | 5 #import "chrome/browser/ui/cocoa/restart_browser.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/ui/browser_list.h" | 8 #include "chrome/browser/lifetime/application_lifetime.h" |
9 #include "grit/chromium_strings.h" | 9 #include "grit/chromium_strings.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
11 #include "grit/ui_strings.h" | 11 #include "grit/ui_strings.h" |
12 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
13 #include "ui/base/l10n/l10n_util_mac.h" | 13 #include "ui/base/l10n/l10n_util_mac.h" |
14 | 14 |
15 // Helper to clean up after the notification that the alert was dismissed. | 15 // Helper to clean up after the notification that the alert was dismissed. |
16 @interface RestartHelper : NSObject { | 16 @interface RestartHelper : NSObject { |
17 @private | 17 @private |
18 NSAlert* alert_; | 18 NSAlert* alert_; |
(...skipping 15 matching lines...) Expand all Loading... |
34 [alert_ release]; | 34 [alert_ release]; |
35 [super dealloc]; | 35 [super dealloc]; |
36 } | 36 } |
37 | 37 |
38 - (void)alertDidEnd:(NSAlert*)alert | 38 - (void)alertDidEnd:(NSAlert*)alert |
39 returnCode:(int)returnCode | 39 returnCode:(int)returnCode |
40 contextInfo:(void*)contextInfo { | 40 contextInfo:(void*)contextInfo { |
41 if (returnCode == NSAlertFirstButtonReturn) { | 41 if (returnCode == NSAlertFirstButtonReturn) { |
42 // Nothing to do. User will restart later. | 42 // Nothing to do. User will restart later. |
43 } else if (returnCode == NSAlertSecondButtonReturn) { | 43 } else if (returnCode == NSAlertSecondButtonReturn) { |
44 BrowserList::AttemptRestart(); | 44 browser::AttemptRestart(); |
45 } else { | 45 } else { |
46 NOTREACHED(); | 46 NOTREACHED(); |
47 } | 47 } |
48 [self autorelease]; | 48 [self autorelease]; |
49 } | 49 } |
50 | 50 |
51 @end | 51 @end |
52 | 52 |
53 namespace restart_browser { | 53 namespace restart_browser { |
54 | 54 |
(...skipping 26 matching lines...) Expand all Loading... |
81 contextInfo:nil]; | 81 contextInfo:nil]; |
82 } else { | 82 } else { |
83 NSInteger returnCode = [alert runModal]; | 83 NSInteger returnCode = [alert runModal]; |
84 [helper alertDidEnd:alert | 84 [helper alertDidEnd:alert |
85 returnCode:returnCode | 85 returnCode:returnCode |
86 contextInfo:NULL]; | 86 contextInfo:NULL]; |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 } // namespace restart_browser | 90 } // namespace restart_browser |
OLD | NEW |