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_PROFILE_IO_DATA_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/prefs/pref_member.h" | 18 #include "base/prefs/pref_member.h" |
19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
21 #include "chrome/browser/io_thread.h" | 21 #include "chrome/browser/io_thread.h" |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/profiles/storage_partition_descriptor.h" | 23 #include "chrome/browser/profiles/storage_partition_descriptor.h" |
24 #include "components/content_settings/core/common/content_settings_types.h" | 24 #include "components/content_settings/core/common/content_settings_types.h" |
| 25 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
25 #include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_sta
ts.h" | 26 #include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_sta
ts.h" |
26 #include "content/public/browser/content_browser_client.h" | 27 #include "content/public/browser/content_browser_client.h" |
27 #include "content/public/browser/resource_context.h" | 28 #include "content/public/browser/resource_context.h" |
28 #include "net/cookies/cookie_monster.h" | 29 #include "net/cookies/cookie_monster.h" |
29 #include "net/http/http_cache.h" | 30 #include "net/http/http_cache.h" |
30 #include "net/http/http_network_session.h" | 31 #include "net/http/http_network_session.h" |
31 #include "net/url_request/url_request_context.h" | 32 #include "net/url_request/url_request_context.h" |
32 #include "net/url_request/url_request_job_factory.h" | 33 #include "net/url_request/url_request_job_factory.h" |
33 | 34 |
34 class ChromeHttpUserAgentSettings; | 35 class ChromeHttpUserAgentSettings; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 169 } |
169 | 170 |
170 net::URLRequestContext* extensions_request_context() const { | 171 net::URLRequestContext* extensions_request_context() const { |
171 return extensions_request_context_.get(); | 172 return extensions_request_context_.get(); |
172 } | 173 } |
173 | 174 |
174 BooleanPrefMember* safe_browsing_enabled() const { | 175 BooleanPrefMember* safe_browsing_enabled() const { |
175 return &safe_browsing_enabled_; | 176 return &safe_browsing_enabled_; |
176 } | 177 } |
177 | 178 |
178 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
179 // TODO(feng): move the function to protected area. | 179 // TODO(feng): move the function to protected area. |
180 // IsDataReductionProxyEnabled() should be used as public API. | 180 // IsDataReductionProxyEnabled() should be used as public API. |
181 BooleanPrefMember* data_reduction_proxy_enabled() const { | 181 BooleanPrefMember* data_reduction_proxy_enabled() const { |
182 return &data_reduction_proxy_enabled_; | 182 return &data_reduction_proxy_enabled_; |
183 } | 183 } |
184 #endif | |
185 | 184 |
186 BooleanPrefMember* printing_enabled() const { | 185 BooleanPrefMember* printing_enabled() const { |
187 return &printing_enabled_; | 186 return &printing_enabled_; |
188 } | 187 } |
189 | 188 |
190 BooleanPrefMember* sync_disabled() const { | 189 BooleanPrefMember* sync_disabled() const { |
191 return &sync_disabled_; | 190 return &sync_disabled_; |
192 } | 191 } |
193 | 192 |
194 BooleanPrefMember* signin_allowed() const { | 193 BooleanPrefMember* signin_allowed() const { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 245 |
247 // Initialize the member needed to track the metrics enabled state. This is | 246 // Initialize the member needed to track the metrics enabled state. This is |
248 // only to be called on the UI thread. | 247 // only to be called on the UI thread. |
249 void InitializeMetricsEnabledStateOnUIThread(); | 248 void InitializeMetricsEnabledStateOnUIThread(); |
250 | 249 |
251 // Returns whether or not metrics reporting is enabled in the browser instance | 250 // Returns whether or not metrics reporting is enabled in the browser instance |
252 // on which this profile resides. This is safe for use from the IO thread, and | 251 // on which this profile resides. This is safe for use from the IO thread, and |
253 // should only be called from there. | 252 // should only be called from there. |
254 bool GetMetricsEnabledStateOnIOThread() const; | 253 bool GetMetricsEnabledStateOnIOThread() const; |
255 | 254 |
256 #if defined(OS_ANDROID) | |
257 // Returns whether or not data reduction proxy is enabled in the browser | 255 // Returns whether or not data reduction proxy is enabled in the browser |
258 // instance on which this profile resides. | 256 // instance on which this profile resides. |
259 bool IsDataReductionProxyEnabled() const; | 257 bool IsDataReductionProxyEnabled() const; |
260 #endif | |
261 | 258 |
262 void set_client_cert_store_factory_for_testing( | 259 void set_client_cert_store_factory_for_testing( |
263 const base::Callback<scoped_ptr<net::ClientCertStore>()>& factory) { | 260 const base::Callback<scoped_ptr<net::ClientCertStore>()>& factory) { |
264 client_cert_store_factory_ = factory; | 261 client_cert_store_factory_ = factory; |
265 } | 262 } |
266 | 263 |
267 protected: | 264 protected: |
268 // A URLRequestContext for media that owns its HTTP factory, to ensure | 265 // A URLRequestContext for media that owns its HTTP factory, to ensure |
269 // it is deleted. | 266 // it is deleted. |
270 class MediaRequestContext : public net::URLRequestContext { | 267 class MediaRequestContext : public net::URLRequestContext { |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 536 |
540 mutable StringListPrefMember one_click_signin_rejected_email_list_; | 537 mutable StringListPrefMember one_click_signin_rejected_email_list_; |
541 | 538 |
542 mutable scoped_refptr<MediaDeviceIDSalt> media_device_id_salt_; | 539 mutable scoped_refptr<MediaDeviceIDSalt> media_device_id_salt_; |
543 | 540 |
544 // Member variables which are pointed to by the various context objects. | 541 // Member variables which are pointed to by the various context objects. |
545 mutable BooleanPrefMember enable_referrers_; | 542 mutable BooleanPrefMember enable_referrers_; |
546 mutable BooleanPrefMember enable_do_not_track_; | 543 mutable BooleanPrefMember enable_do_not_track_; |
547 mutable BooleanPrefMember force_safesearch_; | 544 mutable BooleanPrefMember force_safesearch_; |
548 mutable BooleanPrefMember safe_browsing_enabled_; | 545 mutable BooleanPrefMember safe_browsing_enabled_; |
549 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
550 mutable BooleanPrefMember data_reduction_proxy_enabled_; | 546 mutable BooleanPrefMember data_reduction_proxy_enabled_; |
551 #endif | |
552 mutable BooleanPrefMember printing_enabled_; | 547 mutable BooleanPrefMember printing_enabled_; |
553 mutable BooleanPrefMember sync_disabled_; | 548 mutable BooleanPrefMember sync_disabled_; |
554 mutable BooleanPrefMember signin_allowed_; | 549 mutable BooleanPrefMember signin_allowed_; |
555 mutable BooleanPrefMember network_prediction_enabled_; | 550 mutable BooleanPrefMember network_prediction_enabled_; |
556 mutable IntegerPrefMember network_prediction_options_; | 551 mutable IntegerPrefMember network_prediction_options_; |
557 // TODO(marja): Remove session_startup_pref_ if no longer needed. | 552 // TODO(marja): Remove session_startup_pref_ if no longer needed. |
558 mutable IntegerPrefMember session_startup_pref_; | 553 mutable IntegerPrefMember session_startup_pref_; |
559 mutable BooleanPrefMember quick_check_enabled_; | 554 mutable BooleanPrefMember quick_check_enabled_; |
560 mutable IntegerPrefMember incognito_availibility_pref_; | 555 mutable IntegerPrefMember incognito_availibility_pref_; |
561 | 556 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 | 616 |
622 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 617 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
623 bool initialized_on_UI_thread_; | 618 bool initialized_on_UI_thread_; |
624 | 619 |
625 const Profile::ProfileType profile_type_; | 620 const Profile::ProfileType profile_type_; |
626 | 621 |
627 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 622 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
628 }; | 623 }; |
629 | 624 |
630 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 625 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
OLD | NEW |