OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/chromeos/profiles/profile_helper.h" | 5 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
6 | 6 |
7 #include "base/barrier_closure.h" | 7 #include "base/barrier_closure.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 weak_factory_.GetWeakPtr())); | 256 weak_factory_.GetWeakPtr())); |
257 | 257 |
258 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 258 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
259 // Check if signin profile was loaded. | 259 // Check if signin profile was loaded. |
260 if (profile_manager->GetProfileByPath(GetSigninProfileDir())) { | 260 if (profile_manager->GetProfileByPath(GetSigninProfileDir())) { |
261 LOG_ASSERT(!browsing_data_remover_); | 261 LOG_ASSERT(!browsing_data_remover_); |
262 browsing_data_remover_ = | 262 browsing_data_remover_ = |
263 BrowsingDataRemoverFactory::GetForBrowserContext(GetSigninProfile()); | 263 BrowsingDataRemoverFactory::GetForBrowserContext(GetSigninProfile()); |
264 browsing_data_remover_->AddObserver(this); | 264 browsing_data_remover_->AddObserver(this); |
265 browsing_data_remover_->RemoveAndReply( | 265 browsing_data_remover_->RemoveAndReply( |
266 BrowsingDataRemover::Unbounded(), BrowsingDataRemover::REMOVE_SITE_DATA, | 266 base::Time(), base::Time::Max(), BrowsingDataRemover::REMOVE_SITE_DATA, |
267 BrowsingDataHelper::ALL, this); | 267 BrowsingDataHelper::ALL, this); |
268 } else { | 268 } else { |
269 on_clear_profile_stage_finished_.Run(); | 269 on_clear_profile_stage_finished_.Run(); |
270 } | 270 } |
271 | 271 |
272 if (content::StoragePartition* partition = login::GetSigninPartition()) { | 272 if (content::StoragePartition* partition = login::GetSigninPartition()) { |
273 partition->ClearData( | 273 partition->ClearData( |
274 content::StoragePartition::REMOVE_DATA_MASK_ALL, | 274 content::StoragePartition::REMOVE_DATA_MASK_ALL, |
275 content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, GURL(), | 275 content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, GURL(), |
276 content::StoragePartition::OriginMatcherFunction(), base::Time(), | 276 content::StoragePartition::OriginMatcherFunction(), base::Time(), |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 DownloadPrefs::FromBrowserContext(profile)->DownloadPath()); | 491 DownloadPrefs::FromBrowserContext(profile)->DownloadPath()); |
492 // Let extension system handle extension files. | 492 // Let extension system handle extension files. |
493 excludes.push_back(base::FilePath(extensions::kInstallDirectoryName)); | 493 excludes.push_back(base::FilePath(extensions::kInstallDirectoryName)); |
494 // Do not flush Drive cache. | 494 // Do not flush Drive cache. |
495 excludes.push_back(base::FilePath(chromeos::kDriveCacheDirname)); | 495 excludes.push_back(base::FilePath(chromeos::kDriveCacheDirname)); |
496 | 496 |
497 profile_flusher_->RequestFlush(profile->GetPath(), excludes, base::Closure()); | 497 profile_flusher_->RequestFlush(profile->GetPath(), excludes, base::Closure()); |
498 } | 498 } |
499 | 499 |
500 } // namespace chromeos | 500 } // namespace chromeos |
OLD | NEW |