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/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #include "chrome/browser/profiles/profile_destroyer.h" | 62 #include "chrome/browser/profiles/profile_destroyer.h" |
63 #include "chrome/browser/profiles/profile_info_cache.h" | 63 #include "chrome/browser/profiles/profile_info_cache.h" |
64 #include "chrome/browser/profiles/profile_manager.h" | 64 #include "chrome/browser/profiles/profile_manager.h" |
65 #include "chrome/browser/search_engines/template_url_fetcher.h" | 65 #include "chrome/browser/search_engines/template_url_fetcher.h" |
66 #include "chrome/browser/sessions/session_service_factory.h" | 66 #include "chrome/browser/sessions/session_service_factory.h" |
67 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" | 67 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" |
68 #include "chrome/browser/sync/profile_sync_service_factory.h" | 68 #include "chrome/browser/sync/profile_sync_service_factory.h" |
69 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 69 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
70 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 70 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
71 #include "chrome/browser/user_style_sheet_watcher.h" | 71 #include "chrome/browser/user_style_sheet_watcher.h" |
72 #include "chrome/browser/web_resource/promo_resource_service.h" | |
73 #include "chrome/browser/webdata/web_data_service.h" | 72 #include "chrome/browser/webdata/web_data_service.h" |
74 #include "chrome/common/chrome_constants.h" | 73 #include "chrome/common/chrome_constants.h" |
75 #include "chrome/common/chrome_notification_types.h" | 74 #include "chrome/common/chrome_notification_types.h" |
76 #include "chrome/common/chrome_paths_internal.h" | 75 #include "chrome/common/chrome_paths_internal.h" |
77 #include "chrome/common/chrome_switches.h" | 76 #include "chrome/common/chrome_switches.h" |
78 #include "chrome/common/chrome_version_info.h" | 77 #include "chrome/common/chrome_version_info.h" |
79 #include "chrome/common/pref_names.h" | 78 #include "chrome/common/pref_names.h" |
80 #include "chrome/common/url_constants.h" | 79 #include "chrome/common/url_constants.h" |
81 #include "content/public/browser/browser_thread.h" | 80 #include "content/public/browser/browser_thread.h" |
82 #include "content/public/browser/dom_storage_context.h" | 81 #include "content/public/browser/dom_storage_context.h" |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 host, &zoom_level); | 554 host, &zoom_level); |
556 DCHECK(success); | 555 DCHECK(success); |
557 host_zoom_map->SetZoomLevel(host, zoom_level); | 556 host_zoom_map->SetZoomLevel(host, zoom_level); |
558 } | 557 } |
559 } | 558 } |
560 | 559 |
561 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, | 560 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, |
562 content::Source<HostZoomMap>(host_zoom_map)); | 561 content::Source<HostZoomMap>(host_zoom_map)); |
563 } | 562 } |
564 | 563 |
565 void ProfileImpl::InitPromoResources() { | |
566 if (promo_resource_service_) | |
567 return; | |
568 promo_resource_service_ = new PromoResourceService(this); | |
569 promo_resource_service_->StartAfterDelay(); | |
570 } | |
571 | |
572 FilePath ProfileImpl::last_selected_directory() { | 564 FilePath ProfileImpl::last_selected_directory() { |
573 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); | 565 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); |
574 } | 566 } |
575 | 567 |
576 void ProfileImpl::set_last_selected_directory(const FilePath& path) { | 568 void ProfileImpl::set_last_selected_directory(const FilePath& path) { |
577 GetPrefs()->SetFilePath(prefs::kSelectFileLastDirectory, path); | 569 GetPrefs()->SetFilePath(prefs::kSelectFileLastDirectory, path); |
578 } | 570 } |
579 | 571 |
580 ProfileImpl::~ProfileImpl() { | 572 ProfileImpl::~ProfileImpl() { |
581 MaybeSendDestroyedNotification(); | 573 MaybeSendDestroyedNotification(); |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 if (!path.empty()) | 1139 if (!path.empty()) |
1148 *cache_path = path; | 1140 *cache_path = path; |
1149 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1141 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1150 prefs_->GetInteger(prefs::kDiskCacheSize); | 1142 prefs_->GetInteger(prefs::kDiskCacheSize); |
1151 } | 1143 } |
1152 | 1144 |
1153 base::Callback<ChromeURLDataManagerBackend*(void)> | 1145 base::Callback<ChromeURLDataManagerBackend*(void)> |
1154 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 1146 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
1155 return io_data_.GetChromeURLDataManagerBackendGetter(); | 1147 return io_data_.GetChromeURLDataManagerBackendGetter(); |
1156 } | 1148 } |
OLD | NEW |