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

Side by Side Diff: chrome/browser/ui/cocoa/applescript/window_applescript.mm

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/logging.h" 7 #include "base/logging.h"
8 #import "base/memory/scoped_nsobject.h" 8 #import "base/memory/scoped_nsobject.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return [self initWithProfile:profile]; 63 return [self initWithProfile:profile];
64 } 64 }
65 65
66 - (id)initWithProfile:(Profile*)aProfile { 66 - (id)initWithProfile:(Profile*)aProfile {
67 if (!aProfile) { 67 if (!aProfile) {
68 [self release]; 68 [self release];
69 return nil; 69 return nil;
70 } 70 }
71 71
72 if ((self = [super init])) { 72 if ((self = [super init])) {
73 browser_ = Browser::Create(aProfile); 73 browser_ = new Browser(Browser::CreateParams(aProfile));
74 chrome::NewTab(browser_); 74 chrome::NewTab(browser_);
75 browser_->window()->Show(); 75 browser_->window()->Show();
76 scoped_nsobject<NSNumber> numID( 76 scoped_nsobject<NSNumber> numID(
77 [[NSNumber alloc] initWithInt:browser_->session_id().id()]); 77 [[NSNumber alloc] initWithInt:browser_->session_id().id()]);
78 [self setUniqueID:numID]; 78 [self setUniqueID:numID];
79 } 79 }
80 return self; 80 return self;
81 } 81 }
82 82
83 - (id)initWithBrowser:(Browser*)aBrowser { 83 - (id)initWithBrowser:(Browser*)aBrowser {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 GURL(), FEB_TYPE_FULLSCREEN_EXIT_INSTRUCTION); 259 GURL(), FEB_TYPE_FULLSCREEN_EXIT_INSTRUCTION);
260 } 260 }
261 } 261 }
262 262
263 - (void)handlesExitPresentationMode:(NSScriptCommand*)command { 263 - (void)handlesExitPresentationMode:(NSScriptCommand*)command {
264 if (browser_->window()) 264 if (browser_->window())
265 browser_->window()->ExitPresentationMode(); 265 browser_->window()->ExitPresentationMode();
266 } 266 }
267 267
268 @end 268 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698