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

Side by Side Diff: chrome/browser/profile_resetter/profile_resetter.cc

Issue 2733393003: Split browsing data masks between content and embedder (Closed)
Patch Set: Rebase (merged automatically) Created 3 years, 9 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/profile_resetter/profile_resetter.h" 5 #include "chrome/browser/profile_resetter/profile_resetter.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/synchronization/cancellation_flag.h" 13 #include "base/synchronization/cancellation_flag.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "chrome/browser/browsing_data/browsing_data_helper.h" 15 #include "chrome/browser/browsing_data/browsing_data_helper.h"
16 #include "chrome/browser/browsing_data/browsing_data_remover.h" 16 #include "chrome/browser/browsing_data/browsing_data_remover.h"
17 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" 17 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h"
18 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
18 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 19 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
19 #include "chrome/browser/extensions/extension_service.h" 20 #include "chrome/browser/extensions/extension_service.h"
20 #include "chrome/browser/google/google_url_tracker_factory.h" 21 #include "chrome/browser/google/google_url_tracker_factory.h"
21 #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" 22 #include "chrome/browser/profile_resetter/brandcoded_default_settings.h"
22 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/search_engines/template_url_service_factory.h" 24 #include "chrome/browser/search_engines/template_url_service_factory.h"
24 #include "chrome/browser/ui/browser.h" 25 #include "chrome/browser/ui/browser.h"
25 #include "chrome/browser/ui/browser_list.h" 26 #include "chrome/browser/ui/browser_list.h"
26 #include "chrome/browser/ui/tabs/tab_strip_model.h" 27 #include "chrome/browser/ui/tabs/tab_strip_model.h"
27 #include "chrome/common/pref_names.h" 28 #include "chrome/common/pref_names.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 246 }
246 MarkAsDone(CONTENT_SETTINGS); 247 MarkAsDone(CONTENT_SETTINGS);
247 } 248 }
248 249
249 void ProfileResetter::ResetCookiesAndSiteData() { 250 void ProfileResetter::ResetCookiesAndSiteData() {
250 DCHECK(CalledOnValidThread()); 251 DCHECK(CalledOnValidThread());
251 DCHECK(!cookies_remover_); 252 DCHECK(!cookies_remover_);
252 253
253 cookies_remover_ = BrowsingDataRemoverFactory::GetForBrowserContext(profile_); 254 cookies_remover_ = BrowsingDataRemoverFactory::GetForBrowserContext(profile_);
254 cookies_remover_->AddObserver(this); 255 cookies_remover_->AddObserver(this);
255 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA | 256 int remove_mask = ChromeBrowsingDataRemoverDelegate::DATA_TYPE_SITE_DATA |
256 BrowsingDataRemover::REMOVE_CACHE; 257 BrowsingDataRemover::DATA_TYPE_CACHE;
257 PrefService* prefs = profile_->GetPrefs(); 258 PrefService* prefs = profile_->GetPrefs();
258 DCHECK(prefs); 259 DCHECK(prefs);
259 260
260 // Don't try to clear LSO data if it's not supported. 261 // Don't try to clear LSO data if it's not supported.
261 if (!prefs->GetBoolean(prefs::kClearPluginLSODataEnabled)) 262 if (!prefs->GetBoolean(prefs::kClearPluginLSODataEnabled))
262 remove_mask &= ~BrowsingDataRemover::REMOVE_PLUGIN_DATA; 263 remove_mask &= ~ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA;
263 cookies_remover_->RemoveAndReply(base::Time(), base::Time::Max(), remove_mask, 264 cookies_remover_->RemoveAndReply(
264 BrowsingDataHelper::UNPROTECTED_WEB, this); 265 base::Time(), base::Time::Max(), remove_mask,
266 BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB, this);
265 } 267 }
266 268
267 void ProfileResetter::ResetExtensions() { 269 void ProfileResetter::ResetExtensions() {
268 DCHECK(CalledOnValidThread()); 270 DCHECK(CalledOnValidThread());
269 271
270 std::vector<std::string> brandcode_extensions; 272 std::vector<std::string> brandcode_extensions;
271 master_settings_->GetExtensions(&brandcode_extensions); 273 master_settings_->GetExtensions(&brandcode_extensions);
272 274
273 ExtensionService* extension_service = 275 ExtensionService* extension_service =
274 extensions::ExtensionSystem::Get(profile_)->extension_service(); 276 extensions::ExtensionSystem::Get(profile_)->extension_service();
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 chrome_exe, 383 chrome_exe,
382 false, 384 false,
383 cancel, 385 cancel,
384 &shortcuts); 386 &shortcuts);
385 } 387 }
386 return shortcuts; 388 return shortcuts;
387 #else 389 #else
388 return std::vector<ShortcutCommand>(); 390 return std::vector<ShortcutCommand>();
389 #endif 391 #endif
390 } 392 }
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/browser/profiles/profiles_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698