Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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/cocoa/bug_report_window_controller.h" | 5 #import "chrome/browser/cocoa/bug_report_window_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/bug_report_util.h" | 10 #include "chrome/browser/bug_report_util.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 - (void)windowWillClose:(NSNotification*)notification { | 89 - (void)windowWillClose:(NSNotification*)notification { |
| 90 [self autorelease]; | 90 [self autorelease]; |
| 91 } | 91 } |
| 92 | 92 |
| 93 - (void)closeDialog { | 93 - (void)closeDialog { |
| 94 [NSApp stopModal]; | 94 [NSApp stopModal]; |
| 95 [[self window] close]; | 95 [[self window] close]; |
| 96 } | 96 } |
| 97 | 97 |
| 98 - (void)runModalDialog { | 98 - (void)runModalDialog { |
| 99 [NSApp runModalForWindow:[self window]]; | 99 NSWindow* bugReportWindow = [self window]; |
| 100 [bugReportWindow center]; | |
|
Avi (use Gerrit)
2009/11/04 22:50:55
The docs say that -center is called automatically
| |
| 101 [NSApp runModalForWindow:bugReportWindow]; | |
| 100 } | 102 } |
| 101 | 103 |
| 102 - (IBAction)sendReport:(id)sender { | 104 - (IBAction)sendReport:(id)sender { |
| 103 if ([self isPhishingReport]) { | 105 if ([self isPhishingReport]) { |
| 104 BugReportUtil::ReportPhishing(currentTab_, | 106 BugReportUtil::ReportPhishing(currentTab_, |
| 105 base::SysNSStringToUTF8(pageURL_)); | 107 base::SysNSStringToUTF8(pageURL_)); |
| 106 } else { | 108 } else { |
| 107 BugReportUtil::SendReport( | 109 BugReportUtil::SendReport( |
| 108 profile_, | 110 profile_, |
| 109 base::SysNSStringToUTF8(pageTitle_), | 111 base::SysNSStringToUTF8(pageTitle_), |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 NSSet* paths = [super keyPathsForValuesAffectingValueForKey:key]; | 150 NSSet* paths = [super keyPathsForValuesAffectingValueForKey:key]; |
| 149 if ([key isEqualToString:@"isPhishingReport"]) { | 151 if ([key isEqualToString:@"isPhishingReport"]) { |
| 150 paths = [paths setByAddingObject:@"bugType"]; | 152 paths = [paths setByAddingObject:@"bugType"]; |
| 151 } | 153 } |
| 152 return paths; | 154 return paths; |
| 153 } | 155 } |
| 154 | 156 |
| 155 @end | 157 @end |
| 156 | 158 |
| 157 | 159 |
| OLD | NEW |