| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/first_run_dialog.h" | 5 #import "chrome/browser/cocoa/first_run_dialog.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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 - (void)dealloc { | 71 - (void)dealloc { |
| 72 [super dealloc]; | 72 [super dealloc]; |
| 73 } | 73 } |
| 74 | 74 |
| 75 - (IBAction)showWindow:(id)sender { | 75 - (IBAction)showWindow:(id)sender { |
| 76 // The main MessageLoop has not yet run, but has been spun. If we call | 76 // The main MessageLoop has not yet run, but has been spun. If we call |
| 77 // -[NSApplication runModalForWindow:] we will hang <http://crbug.com/54248>. | 77 // -[NSApplication runModalForWindow:] we will hang <http://crbug.com/54248>. |
| 78 // Therefore the main MessageLoop is run so things work. | 78 // Therefore the main MessageLoop is run so things work. |
| 79 | 79 |
| 80 scoped_refptr<FirstRunShowBridge> bridge = new FirstRunShowBridge(self); | 80 scoped_refptr<FirstRunShowBridge> bridge(new FirstRunShowBridge(self)); |
| 81 MessageLoop::current()->PostTask( | 81 MessageLoop::current()->PostTask( |
| 82 FROM_HERE, | 82 FROM_HERE, |
| 83 NewRunnableMethod(bridge.get(), | 83 NewRunnableMethod(bridge.get(), |
| 84 &FirstRunShowBridge::ShowDialog)); | 84 &FirstRunShowBridge::ShowDialog)); |
| 85 MessageLoop::current()->Run(); | 85 MessageLoop::current()->Run(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 - (void)show { | 88 - (void)show { |
| 89 NSWindow* win = [self window]; | 89 NSWindow* win = [self window]; |
| 90 | 90 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 [NSApp stopModal]; | 186 [NSApp stopModal]; |
| 187 } | 187 } |
| 188 | 188 |
| 189 - (IBAction)learnMore:(id)sender { | 189 - (IBAction)learnMore:(id)sender { |
| 190 NSString* urlStr = l10n_util::GetNSString(IDS_LEARN_MORE_REPORTING_URL); | 190 NSString* urlStr = l10n_util::GetNSString(IDS_LEARN_MORE_REPORTING_URL); |
| 191 NSURL* learnMoreUrl = [NSURL URLWithString:urlStr]; | 191 NSURL* learnMoreUrl = [NSURL URLWithString:urlStr]; |
| 192 [[NSWorkspace sharedWorkspace] openURL:learnMoreUrl]; | 192 [[NSWorkspace sharedWorkspace] openURL:learnMoreUrl]; |
| 193 } | 193 } |
| 194 | 194 |
| 195 @end | 195 @end |
| OLD | NEW |