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

Side by Side Diff: chrome/browser/chromeos/profiles/profile_helper.cc

Issue 2697123004: Convert RemoveDataMask from enum to pointers and split it between content and embedder (Closed)
Patch Set: Android compilation Created 3 years, 10 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 (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"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/browsing_data/browsing_data_helper.h" 12 #include "chrome/browser/browsing_data/browsing_data_helper.h"
13 #include "chrome/browser/browsing_data/browsing_data_remover.h" 13 #include "chrome/browser/browsing_data/browsing_data_remover.h"
14 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" 14 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h"
15 #include "chrome/browser/browsing_data/chrome_browsing_data_types.h"
15 #include "chrome/browser/chromeos/base/file_flusher.h" 16 #include "chrome/browser/chromeos/base/file_flusher.h"
16 #include "chrome/browser/chromeos/login/helper.h" 17 #include "chrome/browser/chromeos/login/helper.h"
17 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h" 18 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h"
18 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" 19 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
19 #include "chrome/browser/download/download_prefs.h" 20 #include "chrome/browser/download/download_prefs.h"
20 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/profiles/profile_manager.h" 22 #include "chrome/browser/profiles/profile_manager.h"
22 #include "chrome/browser/profiles/profiles_state.h" 23 #include "chrome/browser/profiles/profiles_state.h"
23 #include "chrome/common/chrome_constants.h" 24 #include "chrome/common/chrome_constants.h"
24 #include "chrome/common/chrome_switches.h" 25 #include "chrome/common/chrome_switches.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 base::BarrierClosure(2, base::Bind(&ProfileHelper::OnSigninProfileCleared, 256 base::BarrierClosure(2, base::Bind(&ProfileHelper::OnSigninProfileCleared,
256 weak_factory_.GetWeakPtr())); 257 weak_factory_.GetWeakPtr()));
257 258
258 ProfileManager* profile_manager = g_browser_process->profile_manager(); 259 ProfileManager* profile_manager = g_browser_process->profile_manager();
259 // Check if signin profile was loaded. 260 // Check if signin profile was loaded.
260 if (profile_manager->GetProfileByPath(GetSigninProfileDir())) { 261 if (profile_manager->GetProfileByPath(GetSigninProfileDir())) {
261 LOG_ASSERT(!browsing_data_remover_); 262 LOG_ASSERT(!browsing_data_remover_);
262 browsing_data_remover_ = 263 browsing_data_remover_ =
263 BrowsingDataRemoverFactory::GetForBrowserContext(GetSigninProfile()); 264 BrowsingDataRemoverFactory::GetForBrowserContext(GetSigninProfile());
264 browsing_data_remover_->AddObserver(this); 265 browsing_data_remover_->AddObserver(this);
265 browsing_data_remover_->RemoveAndReply( 266 browsing_data_remover_->RemoveAndReply(base::Time(), base::Time::Max(),
266 base::Time(), base::Time::Max(), BrowsingDataRemover::REMOVE_SITE_DATA, 267 BrowsingDataTypeSetSiteData(),
267 BrowsingDataHelper::ALL, this); 268 BrowsingDataHelper::ALL, this);
268 } else { 269 } else {
269 on_clear_profile_stage_finished_.Run(); 270 on_clear_profile_stage_finished_.Run();
270 } 271 }
271 272
272 if (content::StoragePartition* partition = login::GetSigninPartition()) { 273 if (content::StoragePartition* partition = login::GetSigninPartition()) {
273 partition->ClearData( 274 partition->ClearData(
274 content::StoragePartition::REMOVE_DATA_MASK_ALL, 275 content::StoragePartition::REMOVE_DATA_MASK_ALL,
275 content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, GURL(), 276 content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, GURL(),
276 content::StoragePartition::OriginMatcherFunction(), base::Time(), 277 content::StoragePartition::OriginMatcherFunction(), base::Time(),
277 base::Time::Now(), on_clear_profile_stage_finished_); 278 base::Time::Now(), on_clear_profile_stage_finished_);
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 DownloadPrefs::FromBrowserContext(profile)->DownloadPath()); 492 DownloadPrefs::FromBrowserContext(profile)->DownloadPath());
492 // Let extension system handle extension files. 493 // Let extension system handle extension files.
493 excludes.push_back(base::FilePath(extensions::kInstallDirectoryName)); 494 excludes.push_back(base::FilePath(extensions::kInstallDirectoryName));
494 // Do not flush Drive cache. 495 // Do not flush Drive cache.
495 excludes.push_back(base::FilePath(chromeos::kDriveCacheDirname)); 496 excludes.push_back(base::FilePath(chromeos::kDriveCacheDirname));
496 497
497 profile_flusher_->RequestFlush(profile->GetPath(), excludes, base::Closure()); 498 profile_flusher_->RequestFlush(profile->GetPath(), excludes, base::Closure());
498 } 499 }
499 500
500 } // namespace chromeos 501 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698