Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_impl.cc

Issue 33753002: Sooper experimental refactoring of the profile info cache. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager_util.cc ('k') | chrome/browser/ui/app_list/app_list_view_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698