OLD | NEW |
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/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
6 | 6 |
7 #include "app/clipboard/clipboard.h" | 7 #include "app/clipboard/clipboard.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 DOMStorageContext::ClearLocalState(profile_path, chrome::kExtensionScheme); | 261 DOMStorageContext::ClearLocalState(profile_path, chrome::kExtensionScheme); |
262 webkit_database::DatabaseTracker::ClearLocalState(profile_path, | 262 webkit_database::DatabaseTracker::ClearLocalState(profile_path, |
263 chrome::kExtensionScheme); | 263 chrome::kExtensionScheme); |
264 ChromeAppCacheService::ClearLocalState(profile_path); | 264 ChromeAppCacheService::ClearLocalState(profile_path); |
265 } | 265 } |
266 | 266 |
267 bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { | 267 bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { |
268 FilePath user_data_dir; | 268 FilePath user_data_dir; |
269 Profile* profile; | 269 Profile* profile; |
270 | 270 |
| 271 // Check for the existance of a profile manager. When quitting early, |
| 272 // e.g. because another chrome instance is running, or when invoked with |
| 273 // options such as --uninstall or --try-chrome-again=0, the profile manager |
| 274 // does not exist yet. |
| 275 if (!profile_manager_.get()) |
| 276 return false; |
| 277 |
271 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | 278 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
272 profile = profile_manager_->GetDefaultProfile(user_data_dir); | 279 profile = profile_manager_->GetDefaultProfile(user_data_dir); |
273 *profile_path = profile->GetPath(); | 280 *profile_path = profile->GetPath(); |
274 return profile->GetPrefs()->GetBoolean(prefs::kClearSiteDataOnExit); | 281 return profile->GetPrefs()->GetBoolean(prefs::kClearSiteDataOnExit); |
275 } | 282 } |
276 | 283 |
277 void BrowserProcessImpl::CreateResourceDispatcherHost() { | 284 void BrowserProcessImpl::CreateResourceDispatcherHost() { |
278 DCHECK(!created_resource_dispatcher_host_ && | 285 DCHECK(!created_resource_dispatcher_host_ && |
279 resource_dispatcher_host_.get() == NULL); | 286 resource_dispatcher_host_.get() == NULL); |
280 created_resource_dispatcher_host_ = true; | 287 created_resource_dispatcher_host_ = true; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 DCHECK(file_thread_->message_loop() == MessageLoop::current()); | 487 DCHECK(file_thread_->message_loop() == MessageLoop::current()); |
481 bool result = false; | 488 bool result = false; |
482 | 489 |
483 FilePath inspector_dir; | 490 FilePath inspector_dir; |
484 if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) { | 491 if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) { |
485 result = file_util::PathExists(inspector_dir); | 492 result = file_util::PathExists(inspector_dir); |
486 } | 493 } |
487 | 494 |
488 have_inspector_files_ = result; | 495 have_inspector_files_ = result; |
489 } | 496 } |
OLD | NEW |