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

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_mac.mm

Issue 17769005: Rewrite scoped_ptr<T>(NULL) to use the default ctor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include <ApplicationServices/ApplicationServices.h> 5 #include <ApplicationServices/ApplicationServices.h>
6 #import <Cocoa/Cocoa.h> 6 #import <Cocoa/Cocoa.h>
7 7
8 #include "apps/app_shim/app_shim_handler_mac.h" 8 #include "apps/app_shim/app_shim_handler_mac.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 profile, extension, NEW_FOREGROUND_TAB)); 241 profile, extension, NEW_FOREGROUND_TAB));
242 } 242 }
243 243
244 void AppListServiceMac::CreateAppList(Profile* requested_profile) { 244 void AppListServiceMac::CreateAppList(Profile* requested_profile) {
245 if (profile() == requested_profile) 245 if (profile() == requested_profile)
246 return; 246 return;
247 247
248 // The Objective C objects might be released at some unknown point in the 248 // The Objective C objects might be released at some unknown point in the
249 // future, so explicitly clear references to C++ objects. 249 // future, so explicitly clear references to C++ objects.
250 [[window_controller_ appListViewController] 250 [[window_controller_ appListViewController]
251 setDelegate:scoped_ptr<app_list::AppListViewDelegate>(NULL)]; 251 setDelegate:scoped_ptr<app_list::AppListViewDelegate>()];
252 252
253 SetProfile(requested_profile); 253 SetProfile(requested_profile);
254 scoped_ptr<app_list::AppListViewDelegate> delegate( 254 scoped_ptr<app_list::AppListViewDelegate> delegate(
255 new AppListViewDelegate(new AppListControllerDelegateCocoa(), profile())); 255 new AppListViewDelegate(new AppListControllerDelegateCocoa(), profile()));
256 window_controller_.reset([[AppListWindowController alloc] init]); 256 window_controller_.reset([[AppListWindowController alloc] init]);
257 [[window_controller_ appListViewController] setDelegate:delegate.Pass()]; 257 [[window_controller_ appListViewController] setDelegate:delegate.Pass()];
258 } 258 }
259 259
260 void AppListServiceMac::Init(Profile* initial_profile) { 260 void AppListServiceMac::Init(Profile* initial_profile) {
261 // On Mac, Init() is called multiple times for a process: any time there is no 261 // On Mac, Init() is called multiple times for a process: any time there is no
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 449
450 // static 450 // static
451 AppListService* AppListService::Get() { 451 AppListService* AppListService::Get() {
452 return AppListServiceMac::GetInstance(); 452 return AppListServiceMac::GetInstance();
453 } 453 }
454 454
455 // static 455 // static
456 void AppListService::InitAll(Profile* initial_profile) { 456 void AppListService::InitAll(Profile* initial_profile) {
457 Get()->Init(initial_profile); 457 Get()->Init(initial_profile);
458 } 458 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_application_mac.mm ('k') | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698