| 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 "chrome/browser/ui/views/app_list/linux/app_list_service_linux.h" | 5 #include "chrome/browser/ui/views/app_list/linux/app_list_service_linux.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
| 9 #include "chrome/browser/shell_integration.h" | 9 #include "chrome/browser/shell_integration.h" |
| 10 #include "chrome/browser/shell_integration_linux.h" | 10 #include "chrome/browser/shell_integration_linux.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return; | 61 return; |
| 62 | 62 |
| 63 // Dismiss the app list asynchronously. This must be done asynchronously | 63 // Dismiss the app list asynchronously. This must be done asynchronously |
| 64 // or our caller will crash, as it expects the app list to remain alive. | 64 // or our caller will crash, as it expects the app list to remain alive. |
| 65 base::ThreadTaskRunnerHandle::Get()->PostTask( | 65 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 66 FROM_HERE, | 66 FROM_HERE, |
| 67 base::Bind(&AppListServiceLinux::DismissAppList, base::Unretained(this))); | 67 base::Bind(&AppListServiceLinux::DismissAppList, base::Unretained(this))); |
| 68 } | 68 } |
| 69 | 69 |
| 70 AppListServiceLinux::AppListServiceLinux() | 70 AppListServiceLinux::AppListServiceLinux() |
| 71 : AppListServiceViews(scoped_ptr<AppListControllerDelegate>( | 71 : AppListServiceViews(std::unique_ptr<AppListControllerDelegate>( |
| 72 new AppListControllerDelegateViews(this))) {} | 72 new AppListControllerDelegateViews(this))) {} |
| 73 | 73 |
| 74 void AppListServiceLinux::OnViewCreated() { | 74 void AppListServiceLinux::OnViewCreated() { |
| 75 shower().app_list()->AddObserver(this); | 75 shower().app_list()->AddObserver(this); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void AppListServiceLinux::OnViewBeingDestroyed() { | 78 void AppListServiceLinux::OnViewBeingDestroyed() { |
| 79 shower().app_list()->RemoveObserver(this); | 79 shower().app_list()->RemoveObserver(this); |
| 80 AppListServiceViews::OnViewBeingDestroyed(); | 80 AppListServiceViews::OnViewBeingDestroyed(); |
| 81 } | 81 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 98 | 98 |
| 99 // static | 99 // static |
| 100 void AppListService::InitAll(Profile* initial_profile, | 100 void AppListService::InitAll(Profile* initial_profile, |
| 101 const base::FilePath& profile_path) { | 101 const base::FilePath& profile_path) { |
| 102 #if defined(USE_ASH) | 102 #if defined(USE_ASH) |
| 103 AppListServiceAsh::GetInstance()->Init(initial_profile); | 103 AppListServiceAsh::GetInstance()->Init(initial_profile); |
| 104 #else | 104 #else |
| 105 AppListServiceLinux::GetInstance()->Init(initial_profile); | 105 AppListServiceLinux::GetInstance()->Init(initial_profile); |
| 106 #endif | 106 #endif |
| 107 } | 107 } |
| OLD | NEW |