| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/applescript/window_applescript.h" | 5 #import "chrome/browser/ui/cocoa/applescript/window_applescript.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #import "base/mac/foundation_util.h" | 10 #import "base/mac/foundation_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return [self initWithProfile:profile]; | 70 return [self initWithProfile:profile]; |
| 71 } | 71 } |
| 72 | 72 |
| 73 - (id)initWithProfile:(Profile*)aProfile { | 73 - (id)initWithProfile:(Profile*)aProfile { |
| 74 if (!aProfile) { | 74 if (!aProfile) { |
| 75 [self release]; | 75 [self release]; |
| 76 return nil; | 76 return nil; |
| 77 } | 77 } |
| 78 | 78 |
| 79 if ((self = [super init])) { | 79 if ((self = [super init])) { |
| 80 browser_ = new Browser(Browser::CreateParams(aProfile)); | 80 browser_ = new Browser(Browser::CreateParams(aProfile, false)); |
| 81 chrome::NewTab(browser_); | 81 chrome::NewTab(browser_); |
| 82 browser_->window()->Show(); | 82 browser_->window()->Show(); |
| 83 base::scoped_nsobject<NSNumber> numID( | 83 base::scoped_nsobject<NSNumber> numID( |
| 84 [[NSNumber alloc] initWithInt:browser_->session_id().id()]); | 84 [[NSNumber alloc] initWithInt:browser_->session_id().id()]); |
| 85 [self setUniqueID:numID]; | 85 [self setUniqueID:numID]; |
| 86 } | 86 } |
| 87 return self; | 87 return self; |
| 88 } | 88 } |
| 89 | 89 |
| 90 - (id)initWithBrowser:(Browser*)aBrowser { | 90 - (id)initWithBrowser:(Browser*)aBrowser { |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 - (void)handlesCloseScriptCommand:(NSCloseCommand*)command { | 254 - (void)handlesCloseScriptCommand:(NSCloseCommand*)command { |
| 255 AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::WINDOW_CLOSE); | 255 AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::WINDOW_CLOSE); |
| 256 | 256 |
| 257 // window() can be NULL during startup. | 257 // window() can be NULL during startup. |
| 258 if (browser_->window()) | 258 if (browser_->window()) |
| 259 browser_->window()->Close(); | 259 browser_->window()->Close(); |
| 260 } | 260 } |
| 261 | 261 |
| 262 @end | 262 @end |
| OLD | NEW |