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/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "chrome/browser/prefs/pref_service_syncable.h" | 35 #include "chrome/browser/prefs/pref_service_syncable.h" |
36 #include "chrome/browser/profiles/profile_dependency_manager.h" | 36 #include "chrome/browser/profiles/profile_dependency_manager.h" |
37 #include "chrome/browser/themes/theme_service.h" | 37 #include "chrome/browser/themes/theme_service.h" |
38 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 38 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
39 #include "chrome/common/chrome_constants.h" | 39 #include "chrome/common/chrome_constants.h" |
40 #include "chrome/common/chrome_paths.h" | 40 #include "chrome/common/chrome_paths.h" |
41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
42 #include "chrome/common/extensions/extension.h" | 42 #include "chrome/common/extensions/extension.h" |
43 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
44 #include "chrome/common/render_messages.h" | 44 #include "chrome/common/render_messages.h" |
| 45 #include "components/user_prefs/user_prefs.h" |
45 #include "content/public/browser/browser_thread.h" | 46 #include "content/public/browser/browser_thread.h" |
46 #include "content/public/browser/host_zoom_map.h" | 47 #include "content/public/browser/host_zoom_map.h" |
47 #include "content/public/browser/render_process_host.h" | 48 #include "content/public/browser/render_process_host.h" |
48 #include "content/public/browser/storage_partition.h" | 49 #include "content/public/browser/storage_partition.h" |
49 #include "content/public/browser/url_data_source.h" | 50 #include "content/public/browser/url_data_source.h" |
50 #include "content/public/browser/web_contents.h" | 51 #include "content/public/browser/web_contents.h" |
51 #include "net/base/transport_security_state.h" | 52 #include "net/base/transport_security_state.h" |
52 #include "net/http/http_server_properties.h" | 53 #include "net/http/http_server_properties.h" |
53 #include "webkit/database/database_tracker.h" | 54 #include "webkit/database/database_tracker.h" |
54 | 55 |
(...skipping 26 matching lines...) Expand all Loading... |
81 | 82 |
82 } // namespace | 83 } // namespace |
83 | 84 |
84 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) | 85 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) |
85 : profile_(real_profile), | 86 : profile_(real_profile), |
86 prefs_(PrefServiceSyncable::IncognitoFromProfile(real_profile)), | 87 prefs_(PrefServiceSyncable::IncognitoFromProfile(real_profile)), |
87 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), | 88 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), |
88 start_time_(Time::Now()), | 89 start_time_(Time::Now()), |
89 zoom_callback_(base::Bind(&OffTheRecordProfileImpl::OnZoomLevelChanged, | 90 zoom_callback_(base::Bind(&OffTheRecordProfileImpl::OnZoomLevelChanged, |
90 base::Unretained(this))) { | 91 base::Unretained(this))) { |
| 92 // Register on BrowserContext. |
| 93 components::UserPrefs::Set(this, prefs_); |
91 } | 94 } |
92 | 95 |
93 void OffTheRecordProfileImpl::Init() { | 96 void OffTheRecordProfileImpl::Init() { |
94 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 97 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
95 | 98 |
96 extensions::ExtensionSystem::Get(this)->InitForOTRProfile(); | 99 extensions::ExtensionSystem::Get(this)->InitForOTRProfile(); |
97 | 100 |
98 DCHECK_NE(IncognitoModePrefs::DISABLED, | 101 DCHECK_NE(IncognitoModePrefs::DISABLED, |
99 IncognitoModePrefs::GetAvailability(profile_->GetPrefs())); | 102 IncognitoModePrefs::GetAvailability(profile_->GetPrefs())); |
100 | 103 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 void OffTheRecordProfileImpl::OnZoomLevelChanged(const std::string& host) { | 497 void OffTheRecordProfileImpl::OnZoomLevelChanged(const std::string& host) { |
495 if (host.empty()) | 498 if (host.empty()) |
496 return; | 499 return; |
497 | 500 |
498 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); | 501 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); |
499 HostZoomMap* parent_host_zoom_map = | 502 HostZoomMap* parent_host_zoom_map = |
500 HostZoomMap::GetForBrowserContext(profile_); | 503 HostZoomMap::GetForBrowserContext(profile_); |
501 double level = parent_host_zoom_map->GetZoomLevel(host); | 504 double level = parent_host_zoom_map->GetZoomLevel(host); |
502 host_zoom_map->SetZoomLevel(host, level); | 505 host_zoom_map->SetZoomLevel(host, level); |
503 } | 506 } |
OLD | NEW |