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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 171 } |
172 | 172 |
173 // Check that there is an app list shim. If enabling and there is not, make one. | 173 // Check that there is an app list shim. If enabling and there is not, make one. |
174 // If disabling with --enable-app-list-shim=0, and there is one, delete it. | 174 // If disabling with --enable-app-list-shim=0, and there is one, delete it. |
175 void CheckAppListShimOnFileThread(const base::FilePath& profile_path) { | 175 void CheckAppListShimOnFileThread(const base::FilePath& profile_path) { |
176 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 176 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
177 const bool enable = | 177 const bool enable = |
178 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppListShim); | 178 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppListShim); |
179 base::FilePath install_path = web_app::GetAppInstallPath( | 179 base::FilePath install_path = web_app::GetAppInstallPath( |
180 GetAppListShortcutInfo(profile_path)); | 180 GetAppListShortcutInfo(profile_path)); |
181 if (enable == file_util::PathExists(install_path)) | 181 if (enable == base::PathExists(install_path)) |
182 return; | 182 return; |
183 | 183 |
184 if (enable) { | 184 if (enable) { |
185 content::BrowserThread::PostTask( | 185 content::BrowserThread::PostTask( |
186 content::BrowserThread::UI, FROM_HERE, | 186 content::BrowserThread::UI, FROM_HERE, |
187 base::Bind(&CreateAppListShim, profile_path)); | 187 base::Bind(&CreateAppListShim, profile_path)); |
188 return; | 188 return; |
189 } | 189 } |
190 | 190 |
191 // Sanity check because deleting things recursively is scary. | 191 // Sanity check because deleting things recursively is scary. |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 | 458 |
459 // static | 459 // static |
460 AppListService* AppListService::Get() { | 460 AppListService* AppListService::Get() { |
461 return AppListServiceMac::GetInstance(); | 461 return AppListServiceMac::GetInstance(); |
462 } | 462 } |
463 | 463 |
464 // static | 464 // static |
465 void AppListService::InitAll(Profile* initial_profile) { | 465 void AppListService::InitAll(Profile* initial_profile) { |
466 Get()->Init(initial_profile); | 466 Get()->Init(initial_profile); |
467 } | 467 } |
OLD | NEW |