OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 if (*pref_name_in == prefs::kSpellCheckDictionary || | 1208 if (*pref_name_in == prefs::kSpellCheckDictionary || |
1208 *pref_name_in == prefs::kEnableSpellCheck) { | 1209 *pref_name_in == prefs::kEnableSpellCheck) { |
1209 ReinitializeSpellCheckHost(true); | 1210 ReinitializeSpellCheckHost(true); |
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 } |
| 1222 if (appcache_service_) { |
| 1223 appcache_service_->SetClearLocalStateOnExit( |
| 1224 clear_local_state_on_exit_); |
| 1225 } |
1220 } | 1226 } |
1221 } else if (NotificationType::THEME_INSTALLED == type) { | 1227 } else if (NotificationType::THEME_INSTALLED == type) { |
1222 DCHECK_EQ(Source<Profile>(source).ptr(), GetOriginalProfile()); | 1228 DCHECK_EQ(Source<Profile>(source).ptr(), GetOriginalProfile()); |
1223 const Extension* extension = Details<const Extension>(details).ptr(); | 1229 const Extension* extension = Details<const Extension>(details).ptr(); |
1224 SetTheme(extension); | 1230 SetTheme(extension); |
1225 } else if (NotificationType::BOOKMARK_MODEL_LOADED == type) { | 1231 } else if (NotificationType::BOOKMARK_MODEL_LOADED == type) { |
1226 GetProfileSyncService(); // Causes lazy-load if sync is enabled. | 1232 GetProfileSyncService(); // Causes lazy-load if sync is enabled. |
1227 registrar_.Remove(this, NotificationType::BOOKMARK_MODEL_LOADED, | 1233 registrar_.Remove(this, NotificationType::BOOKMARK_MODEL_LOADED, |
1228 Source<Profile>(this)); | 1234 Source<Profile>(this)); |
1229 } | 1235 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 } | 1364 } |
1359 | 1365 |
1360 PrerenderManager* ProfileImpl::GetPrerenderManager() { | 1366 PrerenderManager* ProfileImpl::GetPrerenderManager() { |
1361 CommandLine* cl = CommandLine::ForCurrentProcess(); | 1367 CommandLine* cl = CommandLine::ForCurrentProcess(); |
1362 if (!cl->HasSwitch(switches::kEnablePagePrerender)) | 1368 if (!cl->HasSwitch(switches::kEnablePagePrerender)) |
1363 return NULL; | 1369 return NULL; |
1364 if (!prerender_manager_.get()) | 1370 if (!prerender_manager_.get()) |
1365 prerender_manager_.reset(new PrerenderManager(this)); | 1371 prerender_manager_.reset(new PrerenderManager(this)); |
1366 return prerender_manager_.get(); | 1372 return prerender_manager_.get(); |
1367 } | 1373 } |
OLD | NEW |