| OLD | NEW | 
|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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.h" | 5 #include "chrome/browser/profile.h" | 
| 6 | 6 | 
| 7 #include "app/theme_provider.h" | 7 #include "app/theme_provider.h" | 
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" | 
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" | 
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" | 
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" | 
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" | 
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" | 
| 14 #include "chrome/browser/bookmarks/bookmark_model.h" | 14 #include "chrome/browser/bookmarks/bookmark_model.h" | 
| 15 #include "chrome/browser/browser_list.h" | 15 #include "chrome/browser/browser_list.h" | 
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" | 
| 17 #include "chrome/browser/browser_theme_provider.h" | 17 #include "chrome/browser/browser_theme_provider.h" | 
| 18 #include "chrome/browser/download/download_manager.h" | 18 #include "chrome/browser/download/download_manager.h" | 
| 19 #include "chrome/browser/extensions/extension_devtools_manager.h" | 19 #include "chrome/browser/extensions/extension_devtools_manager.h" | 
| 20 #include "chrome/browser/extensions/extension_message_service.h" | 20 #include "chrome/browser/extensions/extension_message_service.h" | 
| 21 #include "chrome/browser/extensions/extension_process_manager.h" | 21 #include "chrome/browser/extensions/extension_process_manager.h" | 
| 22 #include "chrome/browser/extensions/extensions_service.h" | 22 #include "chrome/browser/extensions/extensions_service.h" | 
| 23 #include "chrome/browser/extensions/user_script_master.h" | 23 #include "chrome/browser/extensions/user_script_master.h" | 
| 24 #include "chrome/browser/favicon_service.h" | 24 #include "chrome/browser/favicon_service.h" | 
| 25 #include "chrome/browser/strict_transport_security_persister.h" | 25 #include "chrome/browser/strict_transport_security_persister.h" | 
| 26 #include "chrome/browser/history/history.h" | 26 #include "chrome/browser/history/history.h" | 
| 27 #include "chrome/browser/in_process_webkit/webkit_context.h" | 27 #include "chrome/browser/in_process_webkit/webkit_context.h" | 
| 28 #include "chrome/browser/net/chrome_url_request_context.h" | 28 #include "chrome/browser/net/chrome_url_request_context.h" | 
| 29 #include "chrome/browser/net/ssl_config_service_manager.h" | 29 #include "chrome/browser/net/ssl_config_service_manager.h" | 
|  | 30 #include "chrome/browser/notifications/desktop_notification_service.h" | 
| 30 #include "chrome/browser/password_manager/password_store_default.h" | 31 #include "chrome/browser/password_manager/password_store_default.h" | 
| 31 #include "chrome/browser/privacy_blacklist/blacklist.h" | 32 #include "chrome/browser/privacy_blacklist/blacklist.h" | 
| 32 #include "chrome/browser/profile_manager.h" | 33 #include "chrome/browser/profile_manager.h" | 
| 33 #include "chrome/browser/renderer_host/render_process_host.h" | 34 #include "chrome/browser/renderer_host/render_process_host.h" | 
| 34 #include "chrome/browser/search_engines/template_url_fetcher.h" | 35 #include "chrome/browser/search_engines/template_url_fetcher.h" | 
| 35 #include "chrome/browser/search_engines/template_url_model.h" | 36 #include "chrome/browser/search_engines/template_url_model.h" | 
| 36 #include "chrome/browser/sessions/session_service.h" | 37 #include "chrome/browser/sessions/session_service.h" | 
| 37 #include "chrome/browser/sessions/tab_restore_service.h" | 38 #include "chrome/browser/sessions/tab_restore_service.h" | 
| 38 #include "chrome/browser/spellchecker.h" | 39 #include "chrome/browser/spellchecker.h" | 
| 39 #include "chrome/browser/ssl/ssl_host_state.h" | 40 #include "chrome/browser/ssl/ssl_host_state.h" | 
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 452   } | 453   } | 
| 453 | 454 | 
| 454   virtual bool DidLastSessionExitCleanly() { | 455   virtual bool DidLastSessionExitCleanly() { | 
| 455     return profile_->DidLastSessionExitCleanly(); | 456     return profile_->DidLastSessionExitCleanly(); | 
| 456   } | 457   } | 
| 457 | 458 | 
| 458   virtual BookmarkModel* GetBookmarkModel() { | 459   virtual BookmarkModel* GetBookmarkModel() { | 
| 459     return profile_->GetBookmarkModel(); | 460     return profile_->GetBookmarkModel(); | 
| 460   } | 461   } | 
| 461 | 462 | 
|  | 463   virtual DesktopNotificationService* GetDesktopNotificationService() { | 
|  | 464     return profile_->GetDesktopNotificationService(); | 
|  | 465   } | 
|  | 466 | 
| 462   virtual ProfileSyncService* GetProfileSyncService() { | 467   virtual ProfileSyncService* GetProfileSyncService() { | 
| 463     return NULL; | 468     return NULL; | 
| 464   } | 469   } | 
| 465 | 470 | 
| 466   virtual bool IsSameProfile(Profile* profile) { | 471   virtual bool IsSameProfile(Profile* profile) { | 
| 467     if (profile == static_cast<Profile*>(this)) | 472     if (profile == static_cast<Profile*>(this)) | 
| 468       return true; | 473       return true; | 
| 469     return profile == profile_; | 474     return profile == profile_; | 
| 470   } | 475   } | 
| 471 | 476 | 
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1337   return spellchecker_; | 1342   return spellchecker_; | 
| 1338 } | 1343 } | 
| 1339 | 1344 | 
| 1340 WebKitContext* ProfileImpl::GetWebKitContext() { | 1345 WebKitContext* ProfileImpl::GetWebKitContext() { | 
| 1341   if (!webkit_context_.get()) | 1346   if (!webkit_context_.get()) | 
| 1342     webkit_context_ = new WebKitContext(path_, false); | 1347     webkit_context_ = new WebKitContext(path_, false); | 
| 1343   DCHECK(webkit_context_.get()); | 1348   DCHECK(webkit_context_.get()); | 
| 1344   return webkit_context_.get(); | 1349   return webkit_context_.get(); | 
| 1345 } | 1350 } | 
| 1346 | 1351 | 
|  | 1352 DesktopNotificationService* ProfileImpl::GetDesktopNotificationService() { | 
|  | 1353   DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 
|  | 1354   if (!desktop_notification_service_.get()) { | 
|  | 1355      // TODO(johnnyg): hook this up with notification UI manager. | 
|  | 1356      desktop_notification_service_.reset(new DesktopNotificationService( | 
|  | 1357          this, NULL)); | 
|  | 1358   } | 
|  | 1359 | 
|  | 1360   return desktop_notification_service_.get(); | 
|  | 1361 } | 
|  | 1362 | 
| 1347 void ProfileImpl::MarkAsCleanShutdown() { | 1363 void ProfileImpl::MarkAsCleanShutdown() { | 
| 1348   if (prefs_.get()) { | 1364   if (prefs_.get()) { | 
| 1349     // The session cleanly exited, set kSessionExitedCleanly appropriately. | 1365     // The session cleanly exited, set kSessionExitedCleanly appropriately. | 
| 1350     prefs_->SetBoolean(prefs::kSessionExitedCleanly, true); | 1366     prefs_->SetBoolean(prefs::kSessionExitedCleanly, true); | 
| 1351 | 1367 | 
| 1352     // NOTE: If you change what thread this writes on, be sure and update | 1368     // NOTE: If you change what thread this writes on, be sure and update | 
| 1353     // ChromeFrame::EndSession(). | 1369     // ChromeFrame::EndSession(). | 
| 1354     prefs_->SavePersistentPrefs(); | 1370     prefs_->SavePersistentPrefs(); | 
| 1355   } | 1371   } | 
| 1356 } | 1372 } | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1391 #endif | 1407 #endif | 
| 1392   return NULL; | 1408   return NULL; | 
| 1393 } | 1409 } | 
| 1394 | 1410 | 
| 1395 void ProfileImpl::InitSyncService() { | 1411 void ProfileImpl::InitSyncService() { | 
| 1396 #ifdef CHROME_PERSONALIZATION | 1412 #ifdef CHROME_PERSONALIZATION | 
| 1397   sync_service_.reset(new ProfileSyncService(this)); | 1413   sync_service_.reset(new ProfileSyncService(this)); | 
| 1398   sync_service_->Initialize(); | 1414   sync_service_->Initialize(); | 
| 1399 #endif | 1415 #endif | 
| 1400 } | 1416 } | 
| OLD | NEW | 
|---|