1 // Copyright 2014 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 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
7 #include "ios/public/provider/web/web_ui_ios.h"
8 #include "ios/web/public/web_state/web_state.h"
13 ChromeBrowserState
* ChromeBrowserState::FromBrowserState(
14 web::BrowserState
* browser_state
) {
15 // This is safe; this is the only implementation of BrowserState.
16 return static_cast<ChromeBrowserState
*>(browser_state
);
20 ChromeBrowserState
* ChromeBrowserState::FromWebUIIOS(web::WebUIIOS
* web_ui
) {
21 return FromBrowserState(web_ui
->GetWebState()->GetBrowserState());