diff options
author | sdefresne <sdefresne@chromium.org> | 2014-11-12 01:32:20 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-12 09:32:42 +0000 |
commit | a010b6d50fccb5cadacf8c7d2c3fb6e1246f2a28 (patch) | |
tree | f6b41daaab2dcf4ee41422e64605176b66860bdc /ios/web | |
parent | bf865e0424ac895a0937a07c0218c424713fdb13 (diff) | |
download | chromium_src-a010b6d50fccb5cadacf8c7d2c3fb6e1246f2a28.zip chromium_src-a010b6d50fccb5cadacf8c7d2c3fb6e1246f2a28.tar.gz chromium_src-a010b6d50fccb5cadacf8c7d2c3fb6e1246f2a28.tar.bz2 |
Introduce the BrowserState interface and implementation.
BrowserState is the interface that will serve as alternative to
content::BrowserContext on iOS. This CL introduces the BrowserState interface
and additionally introduces its implementation. BrowserState is not yet wired
up to other objects in the web layer (e.g., WebState); that wiring up will
happen in future CLs.
BUG=419366
Review URL: https://codereview.chromium.org/702663003
Cr-Commit-Position: refs/heads/master@{#303808}
Diffstat (limited to 'ios/web')
-rw-r--r-- | ios/web/browser_state.cc | 13 | ||||
-rw-r--r-- | ios/web/ios_web.gyp | 2 | ||||
-rw-r--r-- | ios/web/public/browser_state.h | 36 |
3 files changed, 51 insertions, 0 deletions
diff --git a/ios/web/browser_state.cc b/ios/web/browser_state.cc new file mode 100644 index 0000000..df2499a --- /dev/null +++ b/ios/web/browser_state.cc @@ -0,0 +1,13 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ios/web/public/browser_state.h" + +namespace web { +BrowserState::BrowserState() { +} + +BrowserState::~BrowserState() { +} +} diff --git a/ios/web/ios_web.gyp b/ios/web/ios_web.gyp index 7522981..df40501d 100644 --- a/ios/web/ios_web.gyp +++ b/ios/web/ios_web.gyp @@ -20,8 +20,10 @@ '../../ui/gfx/gfx.gyp:gfx', ], 'sources': [ + 'browser_state.cc', 'navigation/navigation_item_impl.h', 'navigation/navigation_item_impl.mm', + 'public/browser_state.h', 'public/favicon_status.cc', 'public/favicon_status.h', 'public/navigation_item.h', diff --git a/ios/web/public/browser_state.h b/ios/web/public/browser_state.h new file mode 100644 index 0000000..0b68ef1 --- /dev/null +++ b/ios/web/public/browser_state.h @@ -0,0 +1,36 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_ +#define IOS_WEB_PUBLIC_BROWSER_STATE_H_ + +#include "base/supports_user_data.h" + +namespace net { +class URLRequestContextGetter; +} + +namespace web { + +// This class holds the context needed for a browsing session. +// It lives on the UI thread. All these methods must only be called on the UI +// thread. +class BrowserState : public base::SupportsUserData { + public: + virtual ~BrowserState(); + + // Return whether this BrowserState is incognito. Default is false. + virtual bool IsOffTheRecord() const = 0; + + // Returns the request context information associated with this + // BrowserState. + virtual net::URLRequestContextGetter* GetRequestContext() = 0; + + protected: + BrowserState(); +}; + +} // namespace web + +#endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_ |