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

Unified Diff: chrome/browser/ui/cocoa/repost_form_warning_mac.mm

Issue 8851007: WIP / Do not commit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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/ui/cocoa/repost_form_warning_mac.h ('k') | chrome/browser/ui/cocoa/tab_modal_dialog_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/repost_form_warning_mac.mm
diff --git a/chrome/browser/ui/cocoa/repost_form_warning_mac.mm b/chrome/browser/ui/cocoa/repost_form_warning_mac.mm
deleted file mode 100644
index 4300ac10db2329ccb85f9fee67d0c3101ee3df52..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/cocoa/repost_form_warning_mac.mm
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) 2011 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 "chrome/browser/ui/cocoa/repost_form_warning_mac.h"
-
-#include "base/memory/scoped_nsobject.h"
-#include "chrome/browser/repost_form_warning_controller.h"
-#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
-#include "grit/generated_resources.h"
-#include "ui/base/l10n/l10n_util_mac.h"
-
-// The delegate of the NSAlert used to display the dialog. Forwards the alert's
-// completion event to the C++ class |RepostFormWarningController|.
-@interface RepostDelegate : NSObject {
- RepostFormWarningController* warning_; // weak
-}
-- (id)initWithWarning:(RepostFormWarningController*)warning;
-- (void)alertDidEnd:(NSAlert*)alert
- returnCode:(int)returnCode
- contextInfo:(void*)contextInfo;
-@end
-
-@implementation RepostDelegate
-- (id)initWithWarning:(RepostFormWarningController*)warning {
- if ((self = [super init])) {
- warning_ = warning;
- }
- return self;
-}
-
-- (void)alertDidEnd:(NSAlert*)alert
- returnCode:(int)returnCode
- contextInfo:(void*)contextInfo {
- if (returnCode == NSAlertFirstButtonReturn) {
- warning_->Continue();
- } else {
- warning_->Cancel();
- }
-}
-@end
-
-RepostFormWarningMac* RepostFormWarningMac::Create(NSWindow* parent,
- TabContents* tab_contents) {
- return new RepostFormWarningMac(
- parent,
- new RepostFormWarningController(tab_contents),
- tab_contents);
-}
-
-RepostFormWarningMac::RepostFormWarningMac(
- NSWindow* parent,
- RepostFormWarningController* controller,
- TabContents* tab_contents)
- : ConstrainedWindowMacDelegateSystemSheet(
- [[[RepostDelegate alloc] initWithWarning:controller]
- autorelease],
- @selector(alertDidEnd:returnCode:contextInfo:)),
- controller_(controller),
- tab_contents_(tab_contents) {
- scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]);
- [alert setMessageText:
- l10n_util::GetNSStringWithFixup(IDS_HTTP_POST_WARNING_TITLE)];
- [alert setInformativeText:
- l10n_util::GetNSStringWithFixup(IDS_HTTP_POST_WARNING)];
- [alert addButtonWithTitle:
- l10n_util::GetNSStringWithFixup(IDS_HTTP_POST_WARNING_RESEND)];
- [alert addButtonWithTitle:
- l10n_util::GetNSStringWithFixup(IDS_CANCEL)];
-
- set_sheet(alert);
-
- TabContentsWrapper* wrapper =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents);
- controller->set_window(new ConstrainedWindowMac(wrapper, this));
-}
-
-RepostFormWarningMac::~RepostFormWarningMac() {
- NSWindow* window = [(NSAlert*)sheet() window];
- if (window && is_sheet_open()) {
- [NSApp endSheet:window
- returnCode:NSAlertSecondButtonReturn];
- }
-}
-
-void RepostFormWarningMac::DeleteDelegate() {
- delete this;
-}
« no previous file with comments | « chrome/browser/ui/cocoa/repost_form_warning_mac.h ('k') | chrome/browser/ui/cocoa/tab_modal_dialog_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698