| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/ui/app_list/app_list_service_cocoa_mac.h" | 5 #include "chrome/browser/ui/app_list/app_list_service_cocoa_mac.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "chrome/browser/ui/app_list/app_list_controller_delegate_impl.h" | 8 #include "chrome/browser/ui/app_list/app_list_controller_delegate_impl.h" |
| 9 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" | 9 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
| 10 #import "ui/app_list/cocoa/app_list_view_controller.h" | 10 #import "ui/app_list/cocoa/app_list_view_controller.h" |
| 11 #import "ui/app_list/cocoa/app_list_window_controller.h" | 11 #import "ui/app_list/cocoa/app_list_window_controller.h" |
| 12 | 12 |
| 13 AppListServiceCocoaMac::~AppListServiceCocoaMac() { | 13 AppListServiceCocoaMac::~AppListServiceCocoaMac() { |
| 14 } | 14 } |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 AppListServiceCocoaMac* AppListServiceCocoaMac::GetInstance() { | 17 AppListServiceCocoaMac* AppListServiceCocoaMac::GetInstance() { |
| 18 return Singleton<AppListServiceCocoaMac, | 18 return base::Singleton< |
| 19 LeakySingletonTraits<AppListServiceCocoaMac>>::get(); | 19 AppListServiceCocoaMac, |
| 20 base::LeakySingletonTraits<AppListServiceCocoaMac>>::get(); |
| 20 } | 21 } |
| 21 | 22 |
| 22 void AppListServiceCocoaMac::ShowForProfile(Profile* requested_profile) { | 23 void AppListServiceCocoaMac::ShowForProfile(Profile* requested_profile) { |
| 23 CreateForProfile(requested_profile); | 24 CreateForProfile(requested_profile); |
| 24 DCHECK(ReadyToShow()); | 25 DCHECK(ReadyToShow()); |
| 25 ShowWindowNearDock(); | 26 ShowWindowNearDock(); |
| 26 } | 27 } |
| 27 | 28 |
| 28 Profile* AppListServiceCocoaMac::GetCurrentAppListProfile() { | 29 Profile* AppListServiceCocoaMac::GetCurrentAppListProfile() { |
| 29 return profile_; | 30 return profile_; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // to ensure it will be populated later. | 76 // to ensure it will be populated later. |
| 76 window_controller_.reset([[AppListWindowController alloc] init]); | 77 window_controller_.reset([[AppListWindowController alloc] init]); |
| 77 } | 78 } |
| 78 return true; // Cocoa app list can be shown empty. | 79 return true; // Cocoa app list can be shown empty. |
| 79 } | 80 } |
| 80 | 81 |
| 81 AppListServiceCocoaMac::AppListServiceCocoaMac() | 82 AppListServiceCocoaMac::AppListServiceCocoaMac() |
| 82 : profile_(nullptr), | 83 : profile_(nullptr), |
| 83 controller_delegate_(new AppListControllerDelegateImpl(this)) { | 84 controller_delegate_(new AppListControllerDelegateImpl(this)) { |
| 84 } | 85 } |
| OLD | NEW |