| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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. | |
| 4 | |
| 5 #import "ios/web/public/web_controller_factory.h" | |
| 6 | |
| 7 #include <utility> | |
| 8 | |
| 9 #include "ios/web/public/browser_state.h" | |
| 10 #import "ios/web/web_state/ui/crw_wk_web_view_web_controller.h" | |
| 11 #include "ios/web/web_state/web_state_impl.h" | |
| 12 | |
| 13 namespace web { | |
| 14 | |
| 15 CRWWebController* CreateWebController(std::unique_ptr<WebStateImpl> web_state) { | |
| 16 return | |
| 17 [[CRWWKWebViewWebController alloc] initWithWebState:std::move(web_state)]; | |
| 18 } | |
| 19 | |
| 20 CRWWebController* CreateWebController(BrowserState* browser_state) { | |
| 21 DCHECK(browser_state); | |
| 22 std::unique_ptr<web::WebStateImpl> web_state( | |
| 23 new web::WebStateImpl(browser_state)); | |
| 24 web_state->GetNavigationManagerImpl().InitializeSession(nil, nil, NO, -1); | |
| 25 return CreateWebController(std::move(web_state)); | |
| 26 } | |
| 27 | |
| 28 } // namespace web | |
| OLD | NEW |