OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |