| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // OffTheRecordProfileImpl is a profile subclass that wraps an existing profile | 25 // OffTheRecordProfileImpl is a profile subclass that wraps an existing profile |
| 26 // to make it suitable for the incognito mode. | 26 // to make it suitable for the incognito mode. |
| 27 // | 27 // |
| 28 // Note: This class is a leaf class and is not intended for subclassing. | 28 // Note: This class is a leaf class and is not intended for subclassing. |
| 29 // Providing this header file is for unit testing. | 29 // Providing this header file is for unit testing. |
| 30 // | 30 // |
| 31 //////////////////////////////////////////////////////////////////////////////// | 31 //////////////////////////////////////////////////////////////////////////////// |
| 32 class OffTheRecordProfileImpl : public Profile { | 32 class OffTheRecordProfileImpl : public Profile { |
| 33 public: | 33 public: |
| 34 explicit OffTheRecordProfileImpl(Profile* real_profile); | 34 explicit OffTheRecordProfileImpl(Profile* real_profile); |
| 35 virtual ~OffTheRecordProfileImpl(); | 35 ~OffTheRecordProfileImpl() override; |
| 36 void Init(); | 36 void Init(); |
| 37 | 37 |
| 38 // Profile implementation. | 38 // Profile implementation. |
| 39 virtual std::string GetProfileName() override; | 39 std::string GetProfileName() override; |
| 40 virtual ProfileType GetProfileType() const override; | 40 ProfileType GetProfileType() const override; |
| 41 virtual Profile* GetOffTheRecordProfile() override; | 41 Profile* GetOffTheRecordProfile() override; |
| 42 virtual void DestroyOffTheRecordProfile() override; | 42 void DestroyOffTheRecordProfile() override; |
| 43 virtual bool HasOffTheRecordProfile() override; | 43 bool HasOffTheRecordProfile() override; |
| 44 virtual Profile* GetOriginalProfile() override; | 44 Profile* GetOriginalProfile() override; |
| 45 virtual bool IsSupervised() override; | 45 bool IsSupervised() override; |
| 46 virtual ExtensionSpecialStoragePolicy* | 46 ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override; |
| 47 GetExtensionSpecialStoragePolicy() override; | 47 PrefService* GetPrefs() override; |
| 48 virtual PrefService* GetPrefs() override; | 48 PrefService* GetOffTheRecordPrefs() override; |
| 49 virtual PrefService* GetOffTheRecordPrefs() override; | 49 net::URLRequestContextGetter* GetRequestContextForExtensions() override; |
| 50 virtual net::URLRequestContextGetter* | 50 net::URLRequestContextGetter* CreateRequestContext( |
| 51 GetRequestContextForExtensions() override; | |
| 52 virtual net::URLRequestContextGetter* CreateRequestContext( | |
| 53 content::ProtocolHandlerMap* protocol_handlers, | 51 content::ProtocolHandlerMap* protocol_handlers, |
| 54 content::URLRequestInterceptorScopedVector request_interceptors) override; | 52 content::URLRequestInterceptorScopedVector request_interceptors) override; |
| 55 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( | 53 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 56 const base::FilePath& partition_path, | 54 const base::FilePath& partition_path, |
| 57 bool in_memory, | 55 bool in_memory, |
| 58 content::ProtocolHandlerMap* protocol_handlers, | 56 content::ProtocolHandlerMap* protocol_handlers, |
| 59 content::URLRequestInterceptorScopedVector request_interceptors) override; | 57 content::URLRequestInterceptorScopedVector request_interceptors) override; |
| 60 virtual net::SSLConfigService* GetSSLConfigService() override; | 58 net::SSLConfigService* GetSSLConfigService() override; |
| 61 virtual HostContentSettingsMap* GetHostContentSettingsMap() override; | 59 HostContentSettingsMap* GetHostContentSettingsMap() override; |
| 62 virtual bool IsSameProfile(Profile* profile) override; | 60 bool IsSameProfile(Profile* profile) override; |
| 63 virtual Time GetStartTime() const override; | 61 Time GetStartTime() const override; |
| 64 virtual history::TopSites* GetTopSitesWithoutCreating() override; | 62 history::TopSites* GetTopSitesWithoutCreating() override; |
| 65 virtual history::TopSites* GetTopSites() override; | 63 history::TopSites* GetTopSites() override; |
| 66 virtual base::FilePath last_selected_directory() override; | 64 base::FilePath last_selected_directory() override; |
| 67 virtual void set_last_selected_directory(const base::FilePath& path) override; | 65 void set_last_selected_directory(const base::FilePath& path) override; |
| 68 virtual bool WasCreatedByVersionOrLater(const std::string& version) override; | 66 bool WasCreatedByVersionOrLater(const std::string& version) override; |
| 69 virtual void SetExitType(ExitType exit_type) override; | 67 void SetExitType(ExitType exit_type) override; |
| 70 virtual ExitType GetLastSessionExitType() override; | 68 ExitType GetLastSessionExitType() override; |
| 71 | 69 |
| 72 #if defined(OS_CHROMEOS) | 70 #if defined(OS_CHROMEOS) |
| 73 virtual void ChangeAppLocale(const std::string& locale, | 71 virtual void ChangeAppLocale(const std::string& locale, |
| 74 AppLocaleChangedVia) override; | 72 AppLocaleChangedVia) override; |
| 75 virtual void OnLogin() override; | 73 virtual void OnLogin() override; |
| 76 virtual void InitChromeOSPreferences() override; | 74 virtual void InitChromeOSPreferences() override; |
| 77 #endif // defined(OS_CHROMEOS) | 75 #endif // defined(OS_CHROMEOS) |
| 78 | 76 |
| 79 virtual PrefProxyConfigTracker* GetProxyConfigTracker() override; | 77 PrefProxyConfigTracker* GetProxyConfigTracker() override; |
| 80 | 78 |
| 81 virtual chrome_browser_net::Predictor* GetNetworkPredictor() override; | 79 chrome_browser_net::Predictor* GetNetworkPredictor() override; |
| 82 virtual DevToolsNetworkController* GetDevToolsNetworkController() override; | 80 DevToolsNetworkController* GetDevToolsNetworkController() override; |
| 83 virtual void ClearNetworkingHistorySince( | 81 void ClearNetworkingHistorySince(base::Time time, |
| 84 base::Time time, | 82 const base::Closure& completion) override; |
| 85 const base::Closure& completion) override; | 83 GURL GetHomePage() override; |
| 86 virtual GURL GetHomePage() override; | |
| 87 | 84 |
| 88 // content::BrowserContext implementation: | 85 // content::BrowserContext implementation: |
| 89 virtual base::FilePath GetPath() const override; | 86 base::FilePath GetPath() const override; |
| 90 virtual scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() override; | 87 scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() override; |
| 91 virtual bool IsOffTheRecord() const override; | 88 bool IsOffTheRecord() const override; |
| 92 virtual content::DownloadManagerDelegate* | 89 content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; |
| 93 GetDownloadManagerDelegate() override; | 90 net::URLRequestContextGetter* GetRequestContext() override; |
| 94 virtual net::URLRequestContextGetter* GetRequestContext() override; | 91 net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
| 95 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | |
| 96 int renderer_child_id) override; | 92 int renderer_child_id) override; |
| 97 virtual net::URLRequestContextGetter* GetMediaRequestContext() override; | 93 net::URLRequestContextGetter* GetMediaRequestContext() override; |
| 98 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 94 net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
| 99 int renderer_child_id) override; | 95 int renderer_child_id) override; |
| 100 virtual net::URLRequestContextGetter* | 96 net::URLRequestContextGetter* GetMediaRequestContextForStoragePartition( |
| 101 GetMediaRequestContextForStoragePartition( | 97 const base::FilePath& partition_path, |
| 102 const base::FilePath& partition_path, | 98 bool in_memory) override; |
| 103 bool in_memory) override; | 99 content::ResourceContext* GetResourceContext() override; |
| 104 virtual content::ResourceContext* GetResourceContext() override; | 100 content::BrowserPluginGuestManager* GetGuestManager() override; |
| 105 virtual content::BrowserPluginGuestManager* GetGuestManager() override; | 101 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; |
| 106 virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; | 102 content::PushMessagingService* GetPushMessagingService() override; |
| 107 virtual content::PushMessagingService* GetPushMessagingService() override; | 103 content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; |
| 108 virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; | |
| 109 | 104 |
| 110 private: | 105 private: |
| 111 FRIEND_TEST_ALL_PREFIXES(OffTheRecordProfileImplTest, GetHostZoomMap); | 106 FRIEND_TEST_ALL_PREFIXES(OffTheRecordProfileImplTest, GetHostZoomMap); |
| 112 void InitIoData(); | 107 void InitIoData(); |
| 113 void InitHostZoomMap(); | 108 void InitHostZoomMap(); |
| 114 | 109 |
| 115 #if defined(OS_ANDROID) || defined(OS_IOS) | 110 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 116 void UseSystemProxy(); | 111 void UseSystemProxy(); |
| 117 #endif // defined(OS_ANDROID) || defined(OS_IOS) | 112 #endif // defined(OS_ANDROID) || defined(OS_IOS) |
| 118 | 113 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 136 base::FilePath last_selected_directory_; | 131 base::FilePath last_selected_directory_; |
| 137 | 132 |
| 138 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; | 133 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
| 139 | 134 |
| 140 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; | 135 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; |
| 141 | 136 |
| 142 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); | 137 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); |
| 143 }; | 138 }; |
| 144 | 139 |
| 145 #endif // CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ | 140 #endif // CHROME_BROWSER_PROFILES_OFF_THE_RECORD_PROFILE_IMPL_H_ |
| OLD | NEW |