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

Side by Side Diff: chrome/browser/cocoa/restart_browser.mm

Issue 173606: Add background_tile_view for tiling an image as UI background (about box need... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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
« no previous file with comments | « chrome/browser/cocoa/restart_browser.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "app/l10n_util_mac.h"
6 #import "chrome/browser/cocoa/restart_browser.h"
7 #include "grit/chromium_strings.h"
8 #include "grit/generated_resources.h"
9 #include "grit/app_strings.h"
10
11 // Helper to clean up after the notification that the alert was dismissed.
12 @interface RestartHelper : NSObject {
13 @private
14 NSAlert* alert_;
15 }
16 - (NSAlert*)alert;
17 - (void)alertDidEnd:(NSAlert*)alert
18 returnCode:(int)returnCode
19 contextInfo:(void*)contextInfo;
20 @end
21
22 @implementation RestartHelper
23
24 - (NSAlert*)alert {
25 alert_ = [[NSAlert alloc] init];
26 return alert_;
27 }
28
29 - (void)dealloc {
30 [alert_ release];
31 [super dealloc];
32 }
33
34 - (void)alertDidEnd:(NSAlert*)alert
35 returnCode:(int)returnCode
36 contextInfo:(void*)contextInfo {
37 // Nothing to do, just clean up
38 [self autorelease];
39 }
40
41 @end
42
43 namespace restart_browser {
44
45 void RequestRestart(NSWindow* parent) {
46 NSString* title =
47 l10n_util::GetNSStringFWithFixup(IDS_PLEASE_RESTART_BROWSER,
48 l10n_util::GetStringUTF16(IDS_PRODUCT_NAM E));
49 NSString* text =
50 l10n_util::GetNSStringWithFixup(IDS_OPTIONS_RESTART_REQUIRED);
51 NSString* okBtn = l10n_util::GetNSStringWithFixup(IDS_APP_OK);
52
53 RestartHelper* helper = [[RestartHelper alloc] init];
54
55 NSAlert* alert = [helper alert];
56 [alert setAlertStyle:NSCriticalAlertStyle];
57 [alert setMessageText:title];
58 [alert setInformativeText:text];
59 [alert addButtonWithTitle:okBtn];
60
61 [alert beginSheetModalForWindow:parent
62 modalDelegate:helper
63 didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
64 contextInfo:nil];
65 }
66
67 } // namespace restart_browser
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/restart_browser.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698