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

Side by Side Diff: chrome/browser/profiles/profiles_state.cc

Issue 2578723002: Reduce BrowsingDataRemover's dependencies on Chrome (Closed)
Patch Set: A new callsite appeared through rebase - fixed the compilation error. Created 3 years, 11 months 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/profiles/profiles_state.h" 5 #include "chrome/browser/profiles/profiles_state.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 Profile* profile = g_browser_process->profile_manager()->GetProfileByPath( 235 Profile* profile = g_browser_process->profile_manager()->GetProfileByPath(
236 profile_path); 236 profile_path);
237 if (!profile) 237 if (!profile)
238 return; 238 return;
239 239
240 // For guest profiles the browsing data is in the OTR profile. 240 // For guest profiles the browsing data is in the OTR profile.
241 if (profile->IsGuestSession()) 241 if (profile->IsGuestSession())
242 profile = profile->GetOffTheRecordProfile(); 242 profile = profile->GetOffTheRecordProfile();
243 243
244 BrowsingDataRemoverFactory::GetForBrowserContext(profile)->Remove( 244 BrowsingDataRemoverFactory::GetForBrowserContext(profile)->Remove(
245 BrowsingDataRemover::Unbounded(), 245 base::Time(), base::Time::Max(),
246 BrowsingDataRemover::REMOVE_WIPE_PROFILE, BrowsingDataHelper::ALL); 246 BrowsingDataRemover::REMOVE_WIPE_PROFILE, BrowsingDataHelper::ALL);
247 } 247 }
248 248
249 void SetLastUsedProfile(const std::string& profile_dir) { 249 void SetLastUsedProfile(const std::string& profile_dir) {
250 // We should never be saving the System Profile as the last one used since it 250 // We should never be saving the System Profile as the last one used since it
251 // shouldn't have a browser. 251 // shouldn't have a browser.
252 if (profile_dir == base::FilePath(chrome::kSystemProfileDir).AsUTF8Unsafe()) 252 if (profile_dir == base::FilePath(chrome::kSystemProfileDir).AsUTF8Unsafe())
253 return; 253 return;
254 254
255 PrefService* local_state = g_browser_process->local_state(); 255 PrefService* local_state = g_browser_process->local_state();
(...skipping 16 matching lines...) Expand all
272 at_least_one_regular_profile_present = true; 272 at_least_one_regular_profile_present = true;
273 273
274 if (!entry->IsSigninRequired()) 274 if (!entry->IsSigninRequired())
275 return false; 275 return false;
276 } 276 }
277 } 277 }
278 return at_least_one_regular_profile_present; 278 return at_least_one_regular_profile_present;
279 } 279 }
280 280
281 } // namespace profiles 281 } // namespace profiles
OLDNEW
« no previous file with comments | « chrome/browser/profile_resetter/profile_resetter.cc ('k') | chrome/browser/push_messaging/push_messaging_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698