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 #ifndef CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ |
6 #define CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ | 6 #define CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #include "base/gtest_prod_util.h" |
11 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" | 12 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/browser_list.h" | 14 #include "chrome/browser/ui/browser_list.h" |
14 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
15 | 16 |
16 using base::Time; | 17 using base::Time; |
17 using base::TimeDelta; | 18 using base::TimeDelta; |
18 | 19 |
19 //////////////////////////////////////////////////////////////////////////////// | 20 //////////////////////////////////////////////////////////////////////////////// |
20 // | 21 // |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 107 |
107 // content::BrowserContext implementation: | 108 // content::BrowserContext implementation: |
108 virtual FilePath GetPath() OVERRIDE; | 109 virtual FilePath GetPath() OVERRIDE; |
109 virtual bool IsOffTheRecord() OVERRIDE; | 110 virtual bool IsOffTheRecord() OVERRIDE; |
110 virtual content::DownloadManager* GetDownloadManager() OVERRIDE; | 111 virtual content::DownloadManager* GetDownloadManager() OVERRIDE; |
111 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | 112 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; |
112 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 113 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
113 int renderer_child_id) OVERRIDE; | 114 int renderer_child_id) OVERRIDE; |
114 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; | 115 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; |
115 virtual content::ResourceContext* GetResourceContext() OVERRIDE; | 116 virtual content::ResourceContext* GetResourceContext() OVERRIDE; |
116 virtual content::HostZoomMap* GetHostZoomMap() OVERRIDE; | |
117 virtual content::GeolocationPermissionContext* | 117 virtual content::GeolocationPermissionContext* |
118 GetGeolocationPermissionContext() OVERRIDE; | 118 GetGeolocationPermissionContext() OVERRIDE; |
119 virtual content::SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE; | 119 virtual content::SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE; |
120 virtual bool DidLastSessionExitCleanly() OVERRIDE; | 120 virtual bool DidLastSessionExitCleanly() OVERRIDE; |
121 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; | 121 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; |
122 | 122 |
123 // content::NotificationObserver implementation. | 123 // content::NotificationObserver implementation. |
124 virtual void Observe(int type, | 124 virtual void Observe(int type, |
125 const content::NotificationSource& source, | 125 const content::NotificationSource& source, |
126 const content::NotificationDetails& details) OVERRIDE; | 126 const content::NotificationDetails& details) OVERRIDE; |
127 | 127 |
128 private: | 128 private: |
| 129 FRIEND_TEST_ALL_PREFIXES(OffTheRecordProfileImplTest, GetHostZoomMap); |
| 130 void InitHostZoomMap(); |
| 131 |
129 content::NotificationRegistrar registrar_; | 132 content::NotificationRegistrar registrar_; |
130 | 133 |
131 // The real underlying profile. | 134 // The real underlying profile. |
132 Profile* profile_; | 135 Profile* profile_; |
133 | 136 |
134 // Weak pointer owned by |profile_|. | 137 // Weak pointer owned by |profile_|. |
135 PrefService* prefs_; | 138 PrefService* prefs_; |
136 | 139 |
137 OffTheRecordProfileIOData::Handle io_data_; | 140 OffTheRecordProfileIOData::Handle io_data_; |
138 | 141 |
139 // Must be freed before |io_data_|. While |extension_process_manager_| still | 142 // Must be freed before |io_data_|. While |extension_process_manager_| still |
140 // lives, we handle incoming resource requests from extension processes and | 143 // lives, we handle incoming resource requests from extension processes and |
141 // those require access to the ResourceContext owned by |io_data_|. | 144 // those require access to the ResourceContext owned by |io_data_|. |
142 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 145 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
143 | 146 |
144 // We use a non-persistent content settings map for OTR. | 147 // We use a non-persistent content settings map for OTR. |
145 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 148 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
146 | 149 |
147 // Use a separate zoom map for OTR. | |
148 scoped_refptr<content::HostZoomMap> host_zoom_map_; | |
149 | |
150 // Time we were started. | 150 // Time we were started. |
151 Time start_time_; | 151 Time start_time_; |
152 | 152 |
153 FilePath last_selected_directory_; | 153 FilePath last_selected_directory_; |
154 | 154 |
155 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; | 155 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
156 | 156 |
157 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; | 157 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; |
158 | 158 |
159 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); | 159 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); |
160 }; | 160 }; |
161 | 161 |
162 #endif // CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ | 162 #endif // CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ |
OLD | NEW |