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

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

Issue 6077005: Refactored app cache clear on exit code to happen in the object owning the files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fixes. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 } 568 }
569 569
570 ChromeAppCacheService* ProfileImpl::GetAppCacheService() { 570 ChromeAppCacheService* ProfileImpl::GetAppCacheService() {
571 if (!appcache_service_) { 571 if (!appcache_service_) {
572 appcache_service_ = new ChromeAppCacheService; 572 appcache_service_ = new ChromeAppCacheService;
573 BrowserThread::PostTask( 573 BrowserThread::PostTask(
574 BrowserThread::IO, FROM_HERE, 574 BrowserThread::IO, FROM_HERE,
575 NewRunnableMethod(appcache_service_.get(), 575 NewRunnableMethod(appcache_service_.get(),
576 &ChromeAppCacheService::InitializeOnIOThread, 576 &ChromeAppCacheService::InitializeOnIOThread,
577 GetPath(), IsOffTheRecord(), 577 GetPath(), IsOffTheRecord(),
578 make_scoped_refptr(GetHostContentSettingsMap()))); 578 make_scoped_refptr(GetHostContentSettingsMap()),
579 clear_local_state_on_exit_));
579 } 580 }
580 return appcache_service_; 581 return appcache_service_;
581 } 582 }
582 583
583 webkit_database::DatabaseTracker* ProfileImpl::GetDatabaseTracker() { 584 webkit_database::DatabaseTracker* ProfileImpl::GetDatabaseTracker() {
584 if (!db_tracker_) { 585 if (!db_tracker_) {
585 db_tracker_ = new webkit_database::DatabaseTracker( 586 db_tracker_ = new webkit_database::DatabaseTracker(
586 GetPath(), IsOffTheRecord()); 587 GetPath(), IsOffTheRecord());
587 } 588 }
588 return db_tracker_; 589 return db_tracker_;
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 } else if (*pref_name_in == prefs::kEnableAutoSpellCorrect) { 1211 } else if (*pref_name_in == prefs::kEnableAutoSpellCorrect) {
1211 NotificationService::current()->Notify( 1212 NotificationService::current()->Notify(
1212 NotificationType::SPELLCHECK_AUTOSPELL_TOGGLED, 1213 NotificationType::SPELLCHECK_AUTOSPELL_TOGGLED,
1213 Source<Profile>(this), NotificationService::NoDetails()); 1214 Source<Profile>(this), NotificationService::NoDetails());
1214 } else if (*pref_name_in == prefs::kClearSiteDataOnExit) { 1215 } else if (*pref_name_in == prefs::kClearSiteDataOnExit) {
1215 clear_local_state_on_exit_ = 1216 clear_local_state_on_exit_ =
1216 prefs->GetBoolean(prefs::kClearSiteDataOnExit); 1217 prefs->GetBoolean(prefs::kClearSiteDataOnExit);
1217 if (webkit_context_) 1218 if (webkit_context_)
1218 webkit_context_->set_clear_local_state_on_exit( 1219 webkit_context_->set_clear_local_state_on_exit(
1219 clear_local_state_on_exit_); 1220 clear_local_state_on_exit_);
1221 if (appcache_service_)
jochen (gone - plz use gerrit) 2011/01/05 12:29:51 use { ... }
pastarmovj 2011/01/05 13:47:38 Done.
1222 appcache_service_->SetClearLocalStateOnExit(
1223 clear_local_state_on_exit_);
1220 } 1224 }
1221 } else if (NotificationType::THEME_INSTALLED == type) { 1225 } else if (NotificationType::THEME_INSTALLED == type) {
1222 DCHECK_EQ(Source<Profile>(source).ptr(), GetOriginalProfile()); 1226 DCHECK_EQ(Source<Profile>(source).ptr(), GetOriginalProfile());
1223 const Extension* extension = Details<const Extension>(details).ptr(); 1227 const Extension* extension = Details<const Extension>(details).ptr();
1224 SetTheme(extension); 1228 SetTheme(extension);
1225 } else if (NotificationType::BOOKMARK_MODEL_LOADED == type) { 1229 } else if (NotificationType::BOOKMARK_MODEL_LOADED == type) {
1226 GetProfileSyncService(); // Causes lazy-load if sync is enabled. 1230 GetProfileSyncService(); // Causes lazy-load if sync is enabled.
1227 registrar_.Remove(this, NotificationType::BOOKMARK_MODEL_LOADED, 1231 registrar_.Remove(this, NotificationType::BOOKMARK_MODEL_LOADED,
1228 Source<Profile>(this)); 1232 Source<Profile>(this));
1229 } 1233 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 } 1362 }
1359 1363
1360 PrerenderManager* ProfileImpl::GetPrerenderManager() { 1364 PrerenderManager* ProfileImpl::GetPrerenderManager() {
1361 CommandLine* cl = CommandLine::ForCurrentProcess(); 1365 CommandLine* cl = CommandLine::ForCurrentProcess();
1362 if (!cl->HasSwitch(switches::kEnablePagePrerender)) 1366 if (!cl->HasSwitch(switches::kEnablePagePrerender))
1363 return NULL; 1367 return NULL;
1364 if (!prerender_manager_.get()) 1368 if (!prerender_manager_.get())
1365 prerender_manager_.reset(new PrerenderManager(this)); 1369 prerender_manager_.reset(new PrerenderManager(this));
1366 return prerender_manager_.get(); 1370 return prerender_manager_.get();
1367 } 1371 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698