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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/restart_browser.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/restart_browser.mm
===================================================================
--- chrome/browser/cocoa/restart_browser.mm (revision 0)
+++ chrome/browser/cocoa/restart_browser.mm (revision 0)
@@ -0,0 +1,67 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "app/l10n_util_mac.h"
+#import "chrome/browser/cocoa/restart_browser.h"
+#include "grit/chromium_strings.h"
+#include "grit/generated_resources.h"
+#include "grit/app_strings.h"
+
+// Helper to clean up after the notification that the alert was dismissed.
+@interface RestartHelper : NSObject {
+ @private
+ NSAlert* alert_;
+}
+- (NSAlert*)alert;
+- (void)alertDidEnd:(NSAlert*)alert
+ returnCode:(int)returnCode
+ contextInfo:(void*)contextInfo;
+@end
+
+@implementation RestartHelper
+
+- (NSAlert*)alert {
+ alert_ = [[NSAlert alloc] init];
+ return alert_;
+}
+
+- (void)dealloc {
+ [alert_ release];
+ [super dealloc];
+}
+
+- (void)alertDidEnd:(NSAlert*)alert
+ returnCode:(int)returnCode
+ contextInfo:(void*)contextInfo {
+ // Nothing to do, just clean up
+ [self autorelease];
+}
+
+@end
+
+namespace restart_browser {
+
+void RequestRestart(NSWindow* parent) {
+ NSString* title =
+ l10n_util::GetNSStringFWithFixup(IDS_PLEASE_RESTART_BROWSER,
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
+ NSString* text =
+ l10n_util::GetNSStringWithFixup(IDS_OPTIONS_RESTART_REQUIRED);
+ NSString* okBtn = l10n_util::GetNSStringWithFixup(IDS_APP_OK);
+
+ RestartHelper* helper = [[RestartHelper alloc] init];
+
+ NSAlert* alert = [helper alert];
+ [alert setAlertStyle:NSCriticalAlertStyle];
+ [alert setMessageText:title];
+ [alert setInformativeText:text];
+ [alert addButtonWithTitle:okBtn];
+
+ [alert beginSheetModalForWindow:parent
+ modalDelegate:helper
+ didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
+ contextInfo:nil];
+}
+
+} // namespace restart_browser
Property changes on: chrome/browser/cocoa/restart_browser.mm
___________________________________________________________________
Name: svn:eol-style
+ LF
« 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