OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/string_tokenizer.h" | 15 #include "base/string_tokenizer.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
18 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 18 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
19 #include "chrome/browser/autocomplete/network_action_predictor.h" | |
20 #include "chrome/browser/autofill/personal_data_manager.h" | 19 #include "chrome/browser/autofill/personal_data_manager.h" |
21 #include "chrome/browser/background/background_contents_service_factory.h" | 20 #include "chrome/browser/background/background_contents_service_factory.h" |
22 #include "chrome/browser/background/background_mode_manager.h" | 21 #include "chrome/browser/background/background_mode_manager.h" |
23 #include "chrome/browser/bookmarks/bookmark_model.h" | 22 #include "chrome/browser/bookmarks/bookmark_model.h" |
24 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
25 #include "chrome/browser/browsing_data_remover.h" | 24 #include "chrome/browser/browsing_data_remover.h" |
26 #include "chrome/browser/chrome_plugin_service_filter.h" | 25 #include "chrome/browser/chrome_plugin_service_filter.h" |
27 #include "chrome/browser/content_settings/cookie_settings.h" | 26 #include "chrome/browser/content_settings/cookie_settings.h" |
28 #include "chrome/browser/content_settings/host_content_settings_map.h" | 27 #include "chrome/browser/content_settings/host_content_settings_map.h" |
29 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 28 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 chrome::NOTIFICATION_PROFILE_DESTROYED, | 555 chrome::NOTIFICATION_PROFILE_DESTROYED, |
557 content::Source<Profile>(this), | 556 content::Source<Profile>(this), |
558 content::NotificationService::NoDetails()); | 557 content::NotificationService::NoDetails()); |
559 // Save the session state if we're going to restore the session during the | 558 // Save the session state if we're going to restore the session during the |
560 // next startup. | 559 // next startup. |
561 SessionStartupPref pref = SessionStartupPref::GetStartupPref(this); | 560 SessionStartupPref pref = SessionStartupPref::GetStartupPref(this); |
562 if (pref.type == SessionStartupPref::LAST) { | 561 if (pref.type == SessionStartupPref::LAST) { |
563 if (session_restore_enabled_) | 562 if (session_restore_enabled_) |
564 BrowserContext::SaveSessionState(this); | 563 BrowserContext::SaveSessionState(this); |
565 } else if (clear_local_state_on_exit_) { | 564 } else if (clear_local_state_on_exit_) { |
566 BrowserContext::ClearLocalOnDestruction(this); | 565 BrowserContext::ClearLocalOnDestruction(this); |
567 } | 566 } |
568 | 567 |
569 StopCreateSessionServiceTimer(); | 568 StopCreateSessionServiceTimer(); |
570 | 569 |
571 // Remove pref observers | 570 // Remove pref observers |
572 pref_change_registrar_.RemoveAll(); | 571 pref_change_registrar_.RemoveAll(); |
573 | 572 |
574 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( | 573 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( |
575 io_data_.GetResourceContextNoInit()); | 574 io_data_.GetResourceContextNoInit()); |
576 | 575 |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 FilePath* cache_path, | 1460 FilePath* cache_path, |
1462 int* max_size) { | 1461 int* max_size) { |
1463 DCHECK(cache_path); | 1462 DCHECK(cache_path); |
1464 DCHECK(max_size); | 1463 DCHECK(max_size); |
1465 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1464 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1466 if (!path.empty()) | 1465 if (!path.empty()) |
1467 *cache_path = path; | 1466 *cache_path = path; |
1468 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1467 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1469 prefs_->GetInteger(prefs::kDiskCacheSize); | 1468 prefs_->GetInteger(prefs::kDiskCacheSize); |
1470 } | 1469 } |
OLD | NEW |