OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 6 |
| 7 #include "base/prefs/pref_registry_simple.h" |
| 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/extension_prefs.h" |
| 11 #include "chrome/common/chrome_constants.h" |
| 12 #include "chrome/common/pref_names.h" |
| 13 |
| 14 #if !defined(ENABLE_APP_LIST) |
| 15 #include "chrome/browser/ui/app_list/app_list_service_disabled.h" |
| 16 #endif |
| 17 |
| 18 // Provide a disabled AppListService when ENABLE_APP_LIST is not defined. When |
| 19 // the app list is enabled, implementations of Get and InitAll are defined in |
| 20 // app_list_service_selector.cc . |
| 21 #if !defined(ENABLE_APP_LIST) |
| 22 |
| 23 // static |
| 24 AppListService* AppListService::Get() { |
| 25 return chrome::GetAppListServiceDisabled(); |
| 26 } |
| 27 |
| 28 // static |
| 29 void AppListService::InitAll(Profile* initial_profile) {} |
| 30 |
| 31 #endif // !defined(ENABLE_APP_LIST) |
| 32 |
| 33 // static |
| 34 void AppListService::RegisterPrefs(PrefRegistrySimple* registry) { |
| 35 registry->RegisterStringPref(prefs::kAppListProfile, ""); |
| 36 } |
| 37 |
| 38 void AppListService::Init(Profile* initial_profile) {} |
| 39 |
| 40 base::FilePath AppListService::GetAppListProfilePath( |
| 41 const base::FilePath& user_data_dir) { |
| 42 PrefService* local_state = g_browser_process->local_state(); |
| 43 DCHECK(local_state); |
| 44 |
| 45 std::string app_list_profile; |
| 46 if (local_state->HasPrefPath(prefs::kAppListProfile)) |
| 47 app_list_profile = local_state->GetString(prefs::kAppListProfile); |
| 48 |
| 49 // If the user has no profile preference for the app launcher, default to the |
| 50 // last browser profile used. |
| 51 if (app_list_profile.empty() && |
| 52 local_state->HasPrefPath(prefs::kProfileLastUsed)) |
| 53 app_list_profile = local_state->GetString(prefs::kProfileLastUsed); |
| 54 |
| 55 std::string profile_path = app_list_profile.empty() ? |
| 56 chrome::kInitialProfile : |
| 57 app_list_profile; |
| 58 |
| 59 return user_data_dir.AppendASCII(profile_path); |
| 60 } |
| 61 |
| 62 void AppListService::ShowAppList(Profile* profile) {} |
| 63 |
| 64 void AppListService::DismissAppList() {} |
| 65 |
| 66 void AppListService::SetAppListProfile( |
| 67 const base::FilePath& profile_file_path) {} |
| 68 |
| 69 Profile* AppListService::GetCurrentAppListProfile() { return NULL; } |
| 70 |
| 71 bool AppListService::IsAppListVisible() const { return false; } |
| 72 |
| 73 void AppListService::OnBeginExtensionInstall( |
| 74 Profile* profile, |
| 75 const std::string& extension_id, |
| 76 const std::string& extension_name, |
| 77 const gfx::ImageSkia& installing_icon) {} |
| 78 |
| 79 void AppListService::OnDownloadProgress( |
| 80 Profile* profile, |
| 81 const std::string& extension_id, |
| 82 int percent_downloaded) {} |
| 83 |
| 84 void AppListService::OnExtensionInstallFailure( |
| 85 Profile* profile, |
| 86 const std::string& extension_id) {} |
| 87 |
| 88 void AppListService::OnProfileAdded(const base::FilePath& profilePath) {} |
| 89 |
| 90 void AppListService::OnProfileWillBeRemoved( |
| 91 const base::FilePath& profile_path) {} |
| 92 |
| 93 void AppListService::OnProfileWasRemoved(const base::FilePath& profile_path, |
| 94 const string16& profile_name) {} |
| 95 |
| 96 void AppListService::OnProfileNameChanged(const base::FilePath& profile_path, |
| 97 const string16& profile_name) {} |
| 98 |
| 99 void AppListService::OnProfileAvatarChanged( |
| 100 const base::FilePath& profile_path) {} |
OLD | NEW |