| 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/ui/cocoa/instant_confirm_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/instant_confirm_window_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/mac_util.h" | 8 #include "base/mac/mac_util.h" |
| 9 #include "chrome/browser/instant/instant_confirm_dialog.h" | 9 #include "chrome/browser/instant/instant_confirm_dialog.h" |
| 10 #include "chrome/browser/instant/instant_controller.h" | 10 #include "chrome/browser/instant/instant_controller.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/options/show_options_url.h" | 12 #include "chrome/browser/ui/options/show_options_url.h" |
| 13 #include "gfx/native_widget_types.h" | 13 #include "gfx/native_widget_types.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 15 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
| 16 | 16 |
| 17 namespace browser { | 17 namespace browser { |
| 18 | 18 |
| 19 void ShowInstantConfirmDialog(gfx::NativeWindow parent, Profile* profile) { | 19 void ShowInstantConfirmDialog(gfx::NativeWindow parent, Profile* profile) { |
| 20 InstantConfirmWindowController* controller = | 20 InstantConfirmWindowController* controller = |
| 21 [[InstantConfirmWindowController alloc] initWithProfile:profile]; | 21 [[InstantConfirmWindowController alloc] initWithProfile:profile]; |
| 22 [NSApp beginSheet:[controller window] | 22 [NSApp beginSheet:[controller window] |
| 23 modalForWindow:parent | 23 modalForWindow:parent |
| 24 modalDelegate:nil | 24 modalDelegate:nil |
| 25 didEndSelector:NULL | 25 didEndSelector:NULL |
| 26 contextInfo:NULL]; | 26 contextInfo:NULL]; |
| 27 } | 27 } |
| 28 | 28 |
| 29 } // namespace browser | 29 } // namespace browser |
| 30 | 30 |
| 31 @implementation InstantConfirmWindowController | 31 @implementation InstantConfirmWindowController |
| 32 | 32 |
| 33 - (id)initWithProfile:(Profile*)profile { | 33 - (id)initWithProfile:(Profile*)profile { |
| 34 NSString* nibPath = [mac_util::MainAppBundle() | 34 NSString* nibPath = [base::mac::MainAppBundle() |
| 35 pathForResource:@"InstantConfirm" | 35 pathForResource:@"InstantConfirm" |
| 36 ofType:@"nib"]; | 36 ofType:@"nib"]; |
| 37 if ((self = [super initWithWindowNibPath:nibPath owner:self])) { | 37 if ((self = [super initWithWindowNibPath:nibPath owner:self])) { |
| 38 profile_ = profile; | 38 profile_ = profile; |
| 39 } | 39 } |
| 40 return self; | 40 return self; |
| 41 } | 41 } |
| 42 | 42 |
| 43 - (void)awakeFromNib { | 43 - (void)awakeFromNib { |
| 44 DCHECK([self window]); | 44 DCHECK([self window]); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 67 InstantController::Enable(profile_); | 67 InstantController::Enable(profile_); |
| 68 [self cancel:sender]; | 68 [self cancel:sender]; |
| 69 } | 69 } |
| 70 | 70 |
| 71 - (IBAction)cancel:(id)sender { | 71 - (IBAction)cancel:(id)sender { |
| 72 [NSApp endSheet:[self window]]; | 72 [NSApp endSheet:[self window]]; |
| 73 [[self window] close]; | 73 [[self window] close]; |
| 74 } | 74 } |
| 75 | 75 |
| 76 @end | 76 @end |
| OLD | NEW |