OLD | NEW |
1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 517 |
518 FilePath ProfileImpl::last_selected_directory() { | 518 FilePath ProfileImpl::last_selected_directory() { |
519 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); | 519 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); |
520 } | 520 } |
521 | 521 |
522 void ProfileImpl::set_last_selected_directory(const FilePath& path) { | 522 void ProfileImpl::set_last_selected_directory(const FilePath& path) { |
523 GetPrefs()->SetFilePath(prefs::kSelectFileLastDirectory, path); | 523 GetPrefs()->SetFilePath(prefs::kSelectFileLastDirectory, path); |
524 } | 524 } |
525 | 525 |
526 ProfileImpl::~ProfileImpl() { | 526 ProfileImpl::~ProfileImpl() { |
| 527 // Notify observers that this profile is going to be destroyed soon before |
| 528 // shutting down other members that may hold references to it. |
527 NotificationService::current()->Notify( | 529 NotificationService::current()->Notify( |
528 NotificationType::PROFILE_DESTROYED, | 530 NotificationType::PROFILE_DESTROYED, |
529 Source<Profile>(this), | 531 Source<Profile>(this), |
530 NotificationService::NoDetails()); | 532 NotificationService::NoDetails()); |
531 | 533 |
532 GetPolicyConnector()->Shutdown(); | 534 GetPolicyConnector()->Shutdown(); |
533 | 535 |
534 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); | 536 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); |
535 | 537 |
536 tab_restore_service_ = NULL; | 538 tab_restore_service_ = NULL; |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 return pref_proxy_config_tracker_; | 1502 return pref_proxy_config_tracker_; |
1501 } | 1503 } |
1502 | 1504 |
1503 prerender::PrerenderManager* ProfileImpl::GetPrerenderManager() { | 1505 prerender::PrerenderManager* ProfileImpl::GetPrerenderManager() { |
1504 if (!prerender::PrerenderManager::IsPrerenderingPossible()) | 1506 if (!prerender::PrerenderManager::IsPrerenderingPossible()) |
1505 return NULL; | 1507 return NULL; |
1506 if (!prerender_manager_) | 1508 if (!prerender_manager_) |
1507 prerender_manager_ = new prerender::PrerenderManager(this); | 1509 prerender_manager_ = new prerender::PrerenderManager(this); |
1508 return prerender_manager_; | 1510 return prerender_manager_; |
1509 } | 1511 } |
OLD | NEW |