Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / public / provider / chrome / browser / browser_state / chrome_browser_state.cc
blob62a46ea77f020bd18bdb598b6763523abffd7df3
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"
10 namespace ios {
12 // static
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);
19 // static
20 ChromeBrowserState* ChromeBrowserState::FromWebUIIOS(web::WebUIIOS* web_ui) {
21 return FromBrowserState(web_ui->GetWebState()->GetBrowserState());
24 } // namespace ios