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/environment.h" | 8 #include "base/environment.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/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "chrome/browser/appcache/chrome_appcache_service.h" | 16 #include "chrome/browser/appcache/chrome_appcache_service.h" |
17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
18 #include "chrome/browser/autofill/personal_data_manager.h" | 18 #include "chrome/browser/autofill/personal_data_manager.h" |
19 #include "chrome/browser/background_contents_service.h" | 19 #include "chrome/browser/background_contents_service.h" |
20 #include "chrome/browser/background_mode_manager.h" | 20 #include "chrome/browser/background_mode_manager.h" |
21 #include "chrome/browser/bookmarks/bookmark_model.h" | 21 #include "chrome/browser/bookmarks/bookmark_model.h" |
22 #include "chrome/browser/browser_list.h" | 22 #include "chrome/browser/browser_list.h" |
23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
24 #include "chrome/browser/browser_signin.h" | 24 #include "chrome/browser/browser_signin.h" |
25 #include "chrome/browser/browser_thread.h" | 25 #include "chrome/browser/browser_thread.h" |
26 #include "chrome/browser/chrome_blob_storage_context.h" | 26 #include "chrome/browser/chrome_blob_storage_context.h" |
27 #include "chrome/browser/content_settings/host_content_settings_map.h" | 27 #include "chrome/browser/content_settings/host_content_settings_map.h" |
28 #include "chrome/browser/defaults.h" | 28 #include "chrome/browser/defaults.h" |
| 29 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
29 #include "chrome/browser/dom_ui/ntp_resource_cache.h" | 30 #include "chrome/browser/dom_ui/ntp_resource_cache.h" |
30 #include "chrome/browser/download/download_manager.h" | 31 #include "chrome/browser/download/download_manager.h" |
31 #include "chrome/browser/extensions/default_apps.h" | 32 #include "chrome/browser/extensions/default_apps.h" |
32 #include "chrome/browser/extensions/extension_devtools_manager.h" | 33 #include "chrome/browser/extensions/extension_devtools_manager.h" |
33 #include "chrome/browser/extensions/extension_error_reporter.h" | 34 #include "chrome/browser/extensions/extension_error_reporter.h" |
34 #include "chrome/browser/extensions/extension_event_router.h" | 35 #include "chrome/browser/extensions/extension_event_router.h" |
35 #include "chrome/browser/extensions/extension_info_map.h" | 36 #include "chrome/browser/extensions/extension_info_map.h" |
36 #include "chrome/browser/extensions/extension_io_event_router.h" | 37 #include "chrome/browser/extensions/extension_io_event_router.h" |
37 #include "chrome/browser/extensions/extension_message_service.h" | 38 #include "chrome/browser/extensions/extension_message_service.h" |
38 #include "chrome/browser/extensions/extension_pref_store.h" | 39 #include "chrome/browser/extensions/extension_pref_store.h" |
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 return extension_info_map_.get(); | 1366 return extension_info_map_.get(); |
1366 } | 1367 } |
1367 | 1368 |
1368 policy::ProfilePolicyContext* ProfileImpl::GetPolicyContext() { | 1369 policy::ProfilePolicyContext* ProfileImpl::GetPolicyContext() { |
1369 if (!profile_policy_context_.get()) | 1370 if (!profile_policy_context_.get()) |
1370 profile_policy_context_.reset(new policy::ProfilePolicyContext(this)); | 1371 profile_policy_context_.reset(new policy::ProfilePolicyContext(this)); |
1371 | 1372 |
1372 return profile_policy_context_.get(); | 1373 return profile_policy_context_.get(); |
1373 } | 1374 } |
1374 | 1375 |
| 1376 ChromeURLDataManager* ProfileImpl::GetChromeURLDataManager() { |
| 1377 if (!chrome_url_data_manager_.get()) |
| 1378 chrome_url_data_manager_.reset(new ChromeURLDataManager(this)); |
| 1379 return chrome_url_data_manager_.get(); |
| 1380 } |
| 1381 |
1375 PromoCounter* ProfileImpl::GetInstantPromoCounter() { | 1382 PromoCounter* ProfileImpl::GetInstantPromoCounter() { |
1376 #if defined(OS_WIN) | 1383 #if defined(OS_WIN) |
1377 // TODO: enable this when we're ready to turn on the promo. | 1384 // TODO: enable this when we're ready to turn on the promo. |
1378 /* | 1385 /* |
1379 if (!checked_instant_promo_) { | 1386 if (!checked_instant_promo_) { |
1380 checked_instant_promo_ = true; | 1387 checked_instant_promo_ = true; |
1381 PrefService* prefs = GetPrefs(); | 1388 PrefService* prefs = GetPrefs(); |
1382 if (!prefs->GetBoolean(prefs::kInstantEnabledOnce) && | 1389 if (!prefs->GetBoolean(prefs::kInstantEnabledOnce) && |
1383 !InstantController::IsEnabled(this) && | 1390 !InstantController::IsEnabled(this) && |
1384 InstallUtil::IsChromeSxSProcess()) { | 1391 InstallUtil::IsChromeSxSProcess()) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 } | 1500 } |
1494 | 1501 |
1495 PrerenderManager* ProfileImpl::GetPrerenderManager() { | 1502 PrerenderManager* ProfileImpl::GetPrerenderManager() { |
1496 CommandLine* cl = CommandLine::ForCurrentProcess(); | 1503 CommandLine* cl = CommandLine::ForCurrentProcess(); |
1497 if (!cl->HasSwitch(switches::kEnablePagePrerender)) | 1504 if (!cl->HasSwitch(switches::kEnablePagePrerender)) |
1498 return NULL; | 1505 return NULL; |
1499 if (!prerender_manager_) | 1506 if (!prerender_manager_) |
1500 prerender_manager_ = new PrerenderManager(this); | 1507 prerender_manager_ = new PrerenderManager(this); |
1501 return prerender_manager_; | 1508 return prerender_manager_; |
1502 } | 1509 } |
OLD | NEW |