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/app_list/app_list_service_impl.h" | 5 #include "chrome/browser/ui/app_list/app_list_service_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "apps/pref_names.h" | 9 #include "apps/pref_names.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return profile_manager_->GetProfileByPath(path); | 120 return profile_manager_->GetProfileByPath(path); |
121 } | 121 } |
122 | 122 |
123 virtual base::FilePath GetUserDataDir() OVERRIDE { | 123 virtual base::FilePath GetUserDataDir() OVERRIDE { |
124 return profile_manager_->user_data_dir(); | 124 return profile_manager_->user_data_dir(); |
125 } | 125 } |
126 | 126 |
127 virtual bool IsProfileManaged(const base::FilePath& profile_path) OVERRIDE { | 127 virtual bool IsProfileManaged(const base::FilePath& profile_path) OVERRIDE { |
128 ProfileInfoCache& profile_info = | 128 ProfileInfoCache& profile_info = |
129 g_browser_process->profile_manager()->GetProfileInfoCache(); | 129 g_browser_process->profile_manager()->GetProfileInfoCache(); |
130 size_t profile_index = profile_info.GetIndexOfProfileWithPath(profile_path); | 130 ProfileInfoEntry entry; |
131 return profile_info.ProfileIsManagedAtIndex(profile_index); | 131 if (profile_info.GetInfoForProfile(profile_path, &entry)) { |
| 132 return entry.IsManaged(); |
| 133 } |
| 134 return false; |
132 } | 135 } |
133 | 136 |
134 private: | 137 private: |
135 ProfileManager* profile_manager_; | 138 ProfileManager* profile_manager_; |
136 base::WeakPtrFactory<ProfileStoreImpl> weak_factory_; | 139 base::WeakPtrFactory<ProfileStoreImpl> weak_factory_; |
137 }; | 140 }; |
138 | 141 |
139 } // namespace | 142 } // namespace |
140 | 143 |
141 // static | 144 // static |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 } | 289 } |
287 | 290 |
288 void AppListServiceImpl::SendUsageStats() { | 291 void AppListServiceImpl::SendUsageStats() { |
289 // Send app list usage stats after a delay. | 292 // Send app list usage stats after a delay. |
290 const int kSendUsageStatsDelay = 5; | 293 const int kSendUsageStatsDelay = 5; |
291 base::MessageLoop::current()->PostDelayedTask( | 294 base::MessageLoop::current()->PostDelayedTask( |
292 FROM_HERE, | 295 FROM_HERE, |
293 base::Bind(&AppListServiceImpl::SendAppListStats), | 296 base::Bind(&AppListServiceImpl::SendAppListStats), |
294 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); | 297 base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); |
295 } | 298 } |
OLD | NEW |