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
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
6 #define IOS_WEB_PUBLIC_BROWSER_STATE_H_
8 #include "base/supports_user_data.h"
15 class URLRequestContextGetter
;
20 // This class holds the context needed for a browsing session.
21 // It lives on the UI thread. All these methods must only be called on the UI
23 class BrowserState
: public base::SupportsUserData
{
25 ~BrowserState() override
;
27 // Returns whether this BrowserState is incognito. Default is false.
28 virtual bool IsOffTheRecord() const = 0;
30 // Returns the path where the BrowserState data is stored.
31 virtual base::FilePath
GetPath() const = 0;
33 // Returns the request context information associated with this
35 virtual net::URLRequestContextGetter
* GetRequestContext() = 0;
37 // Safely cast a base::SupportsUserData to a BrowserState. Returns nullptr
38 // if |supports_user_data| is not a BrowserState.
39 static BrowserState
* FromSupportsUserData(
40 base::SupportsUserData
* supports_user_data
);
48 #endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_