OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 IOS_WEB_PUBLIC_BROWSER_STATE_H_ | 5 #ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_ |
6 #define IOS_WEB_PUBLIC_BROWSER_STATE_H_ | 6 #define IOS_WEB_PUBLIC_BROWSER_STATE_H_ |
7 | 7 |
8 #include "base/supports_user_data.h" | 8 #include "base/supports_user_data.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
(...skipping 10 matching lines...) Expand all Loading... |
21 // It lives on the UI thread. All these methods must only be called on the UI | 21 // It lives on the UI thread. All these methods must only be called on the UI |
22 // thread. | 22 // thread. |
23 class BrowserState : public base::SupportsUserData { | 23 class BrowserState : public base::SupportsUserData { |
24 public: | 24 public: |
25 ~BrowserState() override; | 25 ~BrowserState() override; |
26 | 26 |
27 // Returns whether this BrowserState is incognito. Default is false. | 27 // Returns whether this BrowserState is incognito. Default is false. |
28 virtual bool IsOffTheRecord() const = 0; | 28 virtual bool IsOffTheRecord() const = 0; |
29 | 29 |
30 // Returns the path where the BrowserState data is stored. | 30 // Returns the path where the BrowserState data is stored. |
31 virtual base::FilePath GetPath() const = 0; | 31 // Unlike Profile::GetPath(), incognito BrowserState do not share their path |
| 32 // with their original BrowserState. |
| 33 virtual base::FilePath GetStatePath() const = 0; |
32 | 34 |
33 // Returns the request context information associated with this | 35 // Returns the request context information associated with this |
34 // BrowserState. | 36 // BrowserState. |
35 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 37 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
36 | 38 |
37 // Safely cast a base::SupportsUserData to a BrowserState. Returns nullptr | 39 // Safely cast a base::SupportsUserData to a BrowserState. Returns nullptr |
38 // if |supports_user_data| is not a BrowserState. | 40 // if |supports_user_data| is not a BrowserState. |
39 static BrowserState* FromSupportsUserData( | 41 static BrowserState* FromSupportsUserData( |
40 base::SupportsUserData* supports_user_data); | 42 base::SupportsUserData* supports_user_data); |
41 | 43 |
42 protected: | 44 protected: |
43 BrowserState(); | 45 BrowserState(); |
44 }; | 46 }; |
45 | 47 |
46 } // namespace web | 48 } // namespace web |
47 | 49 |
48 #endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_ | 50 #endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_ |
OLD | NEW |