| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 170 } |
| 170 | 171 |
| 171 net::URLRequestContext* extensions_request_context() const { | 172 net::URLRequestContext* extensions_request_context() const { |
| 172 return extensions_request_context_.get(); | 173 return extensions_request_context_.get(); |
| 173 } | 174 } |
| 174 | 175 |
| 175 BooleanPrefMember* safe_browsing_enabled() const { | 176 BooleanPrefMember* safe_browsing_enabled() const { |
| 176 return &safe_browsing_enabled_; | 177 return &safe_browsing_enabled_; |
| 177 } | 178 } |
| 178 | 179 |
| 179 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
| 180 // TODO(feng): move the function to protected area. | 180 // TODO(feng): move the function to protected area. |
| 181 // IsDataReductionProxyEnabled() should be used as public API. | 181 // IsDataReductionProxyEnabled() should be used as public API. |
| 182 BooleanPrefMember* data_reduction_proxy_enabled() const { | 182 BooleanPrefMember* data_reduction_proxy_enabled() const { |
| 183 return &data_reduction_proxy_enabled_; | 183 return &data_reduction_proxy_enabled_; |
| 184 } | 184 } |
| 185 #endif | |
| 186 | 185 |
| 187 BooleanPrefMember* printing_enabled() const { | 186 BooleanPrefMember* printing_enabled() const { |
| 188 return &printing_enabled_; | 187 return &printing_enabled_; |
| 189 } | 188 } |
| 190 | 189 |
| 191 BooleanPrefMember* sync_disabled() const { | 190 BooleanPrefMember* sync_disabled() const { |
| 192 return &sync_disabled_; | 191 return &sync_disabled_; |
| 193 } | 192 } |
| 194 | 193 |
| 195 BooleanPrefMember* signin_allowed() const { | 194 BooleanPrefMember* signin_allowed() const { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 241 |
| 243 // Initialize the member needed to track the metrics enabled state. This is | 242 // Initialize the member needed to track the metrics enabled state. This is |
| 244 // only to be called on the UI thread. | 243 // only to be called on the UI thread. |
| 245 void InitializeMetricsEnabledStateOnUIThread(); | 244 void InitializeMetricsEnabledStateOnUIThread(); |
| 246 | 245 |
| 247 // Returns whether or not metrics reporting is enabled in the browser instance | 246 // Returns whether or not metrics reporting is enabled in the browser instance |
| 248 // on which this profile resides. This is safe for use from the IO thread, and | 247 // on which this profile resides. This is safe for use from the IO thread, and |
| 249 // should only be called from there. | 248 // should only be called from there. |
| 250 bool GetMetricsEnabledStateOnIOThread() const; | 249 bool GetMetricsEnabledStateOnIOThread() const; |
| 251 | 250 |
| 252 #if defined(OS_ANDROID) | |
| 253 // Returns whether or not data reduction proxy is enabled in the browser | 251 // Returns whether or not data reduction proxy is enabled in the browser |
| 254 // instance on which this profile resides. | 252 // instance on which this profile resides. |
| 255 bool IsDataReductionProxyEnabled() const; | 253 bool IsDataReductionProxyEnabled() const; |
| 256 #endif | |
| 257 | 254 |
| 258 void set_client_cert_store_factory_for_testing( | 255 void set_client_cert_store_factory_for_testing( |
| 259 const base::Callback<scoped_ptr<net::ClientCertStore>()>& factory) { | 256 const base::Callback<scoped_ptr<net::ClientCertStore>()>& factory) { |
| 260 client_cert_store_factory_ = factory; | 257 client_cert_store_factory_ = factory; |
| 261 } | 258 } |
| 262 | 259 |
| 263 protected: | 260 protected: |
| 264 // A URLRequestContext for media that owns its HTTP factory, to ensure | 261 // A URLRequestContext for media that owns its HTTP factory, to ensure |
| 265 // it is deleted. | 262 // it is deleted. |
| 266 class MediaRequestContext : public net::URLRequestContext { | 263 class MediaRequestContext : public net::URLRequestContext { |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 | 526 |
| 530 mutable StringListPrefMember one_click_signin_rejected_email_list_; | 527 mutable StringListPrefMember one_click_signin_rejected_email_list_; |
| 531 | 528 |
| 532 mutable scoped_refptr<MediaDeviceIDSalt> media_device_id_salt_; | 529 mutable scoped_refptr<MediaDeviceIDSalt> media_device_id_salt_; |
| 533 | 530 |
| 534 // Member variables which are pointed to by the various context objects. | 531 // Member variables which are pointed to by the various context objects. |
| 535 mutable BooleanPrefMember enable_referrers_; | 532 mutable BooleanPrefMember enable_referrers_; |
| 536 mutable BooleanPrefMember enable_do_not_track_; | 533 mutable BooleanPrefMember enable_do_not_track_; |
| 537 mutable BooleanPrefMember force_safesearch_; | 534 mutable BooleanPrefMember force_safesearch_; |
| 538 mutable BooleanPrefMember safe_browsing_enabled_; | 535 mutable BooleanPrefMember safe_browsing_enabled_; |
| 539 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
| 540 mutable BooleanPrefMember data_reduction_proxy_enabled_; | 536 mutable BooleanPrefMember data_reduction_proxy_enabled_; |
| 541 #endif | |
| 542 mutable BooleanPrefMember printing_enabled_; | 537 mutable BooleanPrefMember printing_enabled_; |
| 543 mutable BooleanPrefMember sync_disabled_; | 538 mutable BooleanPrefMember sync_disabled_; |
| 544 mutable BooleanPrefMember signin_allowed_; | 539 mutable BooleanPrefMember signin_allowed_; |
| 545 mutable IntegerPrefMember network_prediction_options_; | 540 mutable IntegerPrefMember network_prediction_options_; |
| 546 // TODO(marja): Remove session_startup_pref_ if no longer needed. | 541 // TODO(marja): Remove session_startup_pref_ if no longer needed. |
| 547 mutable IntegerPrefMember session_startup_pref_; | 542 mutable IntegerPrefMember session_startup_pref_; |
| 548 mutable BooleanPrefMember quick_check_enabled_; | 543 mutable BooleanPrefMember quick_check_enabled_; |
| 549 mutable IntegerPrefMember incognito_availibility_pref_; | 544 mutable IntegerPrefMember incognito_availibility_pref_; |
| 550 | 545 |
| 551 // The state of metrics reporting in the browser that this profile runs on. | 546 // The state of metrics reporting in the browser that this profile runs on. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 | 608 |
| 614 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 609 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
| 615 bool initialized_on_UI_thread_; | 610 bool initialized_on_UI_thread_; |
| 616 | 611 |
| 617 const Profile::ProfileType profile_type_; | 612 const Profile::ProfileType profile_type_; |
| 618 | 613 |
| 619 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 614 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
| 620 }; | 615 }; |
| 621 | 616 |
| 622 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 617 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| OLD | NEW |