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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "chrome/browser/history/shortcuts_backend.h" | 45 #include "chrome/browser/history/shortcuts_backend.h" |
46 #include "chrome/browser/history/top_sites.h" | 46 #include "chrome/browser/history/top_sites.h" |
47 #include "chrome/browser/instant/instant_controller.h" | 47 #include "chrome/browser/instant/instant_controller.h" |
48 #include "chrome/browser/metrics/metrics_service.h" | 48 #include "chrome/browser/metrics/metrics_service.h" |
49 #include "chrome/browser/net/chrome_url_request_context.h" | 49 #include "chrome/browser/net/chrome_url_request_context.h" |
50 #include "chrome/browser/net/gaia/token_service.h" | 50 #include "chrome/browser/net/gaia/token_service.h" |
51 #include "chrome/browser/net/net_pref_observer.h" | 51 #include "chrome/browser/net/net_pref_observer.h" |
52 #include "chrome/browser/net/predictor.h" | 52 #include "chrome/browser/net/predictor.h" |
53 #include "chrome/browser/net/pref_proxy_config_service.h" | 53 #include "chrome/browser/net/pref_proxy_config_service.h" |
54 #include "chrome/browser/net/ssl_config_service_manager.h" | 54 #include "chrome/browser/net/ssl_config_service_manager.h" |
| 55 #include "chrome/browser/net/url_fixer_upper.h" |
55 #include "chrome/browser/password_manager/password_store_default.h" | 56 #include "chrome/browser/password_manager/password_store_default.h" |
56 #include "chrome/browser/plugin_prefs.h" | 57 #include "chrome/browser/plugin_prefs.h" |
57 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 58 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
58 #include "chrome/browser/prefs/browser_prefs.h" | 59 #include "chrome/browser/prefs/browser_prefs.h" |
59 #include "chrome/browser/prefs/pref_value_store.h" | 60 #include "chrome/browser/prefs/pref_value_store.h" |
60 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 61 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
61 #include "chrome/browser/prerender/prerender_manager_factory.h" | 62 #include "chrome/browser/prerender/prerender_manager_factory.h" |
62 #include "chrome/browser/profiles/profile_dependency_manager.h" | 63 #include "chrome/browser/profiles/profile_dependency_manager.h" |
63 #include "chrome/browser/profiles/profile_info_cache.h" | 64 #include "chrome/browser/profiles/profile_info_cache.h" |
64 #include "chrome/browser/profiles/profile_manager.h" | 65 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 19 matching lines...) Expand all Loading... |
84 #include "chrome/common/chrome_constants.h" | 85 #include "chrome/common/chrome_constants.h" |
85 #include "chrome/common/chrome_notification_types.h" | 86 #include "chrome/common/chrome_notification_types.h" |
86 #include "chrome/common/chrome_paths.h" | 87 #include "chrome/common/chrome_paths.h" |
87 #include "chrome/common/chrome_paths_internal.h" | 88 #include "chrome/common/chrome_paths_internal.h" |
88 #include "chrome/common/chrome_switches.h" | 89 #include "chrome/common/chrome_switches.h" |
89 #include "chrome/common/extensions/extension_permission_set.h" | 90 #include "chrome/common/extensions/extension_permission_set.h" |
90 #include "chrome/common/json_pref_store.h" | 91 #include "chrome/common/json_pref_store.h" |
91 #include "chrome/common/pref_names.h" | 92 #include "chrome/common/pref_names.h" |
92 #include "chrome/common/render_messages.h" | 93 #include "chrome/common/render_messages.h" |
93 #include "chrome/common/spellcheck_messages.h" | 94 #include "chrome/common/spellcheck_messages.h" |
| 95 #include "chrome/common/url_constants.h" |
94 #include "content/browser/appcache/chrome_appcache_service.h" | 96 #include "content/browser/appcache/chrome_appcache_service.h" |
95 #include "content/browser/browser_thread.h" | 97 #include "content/browser/browser_thread.h" |
96 #include "content/browser/chrome_blob_storage_context.h" | 98 #include "content/browser/chrome_blob_storage_context.h" |
97 #include "content/browser/file_system/browser_file_system_helper.h" | 99 #include "content/browser/file_system/browser_file_system_helper.h" |
98 #include "content/browser/host_zoom_map.h" | 100 #include "content/browser/host_zoom_map.h" |
99 #include "content/browser/in_process_webkit/webkit_context.h" | 101 #include "content/browser/in_process_webkit/webkit_context.h" |
100 #include "content/browser/renderer_host/render_process_host.h" | 102 #include "content/browser/renderer_host/render_process_host.h" |
101 #include "content/browser/speech/speech_input_manager.h" | 103 #include "content/browser/speech/speech_input_manager.h" |
102 #include "content/browser/ssl/ssl_host_state.h" | 104 #include "content/browser/ssl/ssl_host_state.h" |
103 #include "content/browser/user_metrics.h" | 105 #include "content/browser/user_metrics.h" |
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1672 } | 1674 } |
1673 | 1675 |
1674 chrome_browser_net::Predictor* ProfileImpl::GetNetworkPredictor() { | 1676 chrome_browser_net::Predictor* ProfileImpl::GetNetworkPredictor() { |
1675 return predictor_; | 1677 return predictor_; |
1676 } | 1678 } |
1677 | 1679 |
1678 void ProfileImpl::ClearNetworkingHistorySince(base::Time time) { | 1680 void ProfileImpl::ClearNetworkingHistorySince(base::Time time) { |
1679 io_data_.ClearNetworkingHistorySince(time); | 1681 io_data_.ClearNetworkingHistorySince(time); |
1680 } | 1682 } |
1681 | 1683 |
| 1684 GURL ProfileImpl::GetHomePage() { |
| 1685 // --homepage overrides any preferences. |
| 1686 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 1687 if (command_line.HasSwitch(switches::kHomePage)) { |
| 1688 // TODO(evanm): clean up usage of DIR_CURRENT. |
| 1689 // http://code.google.com/p/chromium/issues/detail?id=60630 |
| 1690 // For now, allow this code to call getcwd(). |
| 1691 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 1692 |
| 1693 FilePath browser_directory; |
| 1694 PathService::Get(base::DIR_CURRENT, &browser_directory); |
| 1695 GURL home_page(URLFixerUpper::FixupRelativeFile(browser_directory, |
| 1696 command_line.GetSwitchValuePath(switches::kHomePage))); |
| 1697 if (home_page.is_valid()) |
| 1698 return home_page; |
| 1699 } |
| 1700 |
| 1701 if (GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage)) |
| 1702 return GURL(chrome::kChromeUINewTabURL); |
| 1703 GURL home_page(URLFixerUpper::FixupURL( |
| 1704 GetPrefs()->GetString(prefs::kHomePage), |
| 1705 std::string())); |
| 1706 if (!home_page.is_valid()) |
| 1707 return GURL(chrome::kChromeUINewTabURL); |
| 1708 return home_page; |
| 1709 } |
| 1710 |
1682 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1711 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
1683 if (!spellcheck_profile_.get()) | 1712 if (!spellcheck_profile_.get()) |
1684 spellcheck_profile_.reset(new SpellCheckProfile(path_)); | 1713 spellcheck_profile_.reset(new SpellCheckProfile(path_)); |
1685 return spellcheck_profile_.get(); | 1714 return spellcheck_profile_.get(); |
1686 } | 1715 } |
OLD | NEW |