| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef IOS_WEB_VIEW_INTERNAL_CRIWV_WEB_MAIN_PARTS_H_ | |
| 6 #define IOS_WEB_VIEW_INTERNAL_CRIWV_WEB_MAIN_PARTS_H_ | |
| 7 | |
| 8 #include "ios/web/public/app/web_main_parts.h" | |
| 9 | |
| 10 #include <memory> | |
| 11 | |
| 12 @protocol CWVDelegate; | |
| 13 | |
| 14 namespace ios_web_view { | |
| 15 class CWVBrowserState; | |
| 16 | |
| 17 // CWV-specific implementation of WebMainParts. | |
| 18 class CRIWVWebMainParts : public web::WebMainParts { | |
| 19 public: | |
| 20 explicit CRIWVWebMainParts(id<CWVDelegate> delegate); | |
| 21 ~CRIWVWebMainParts() override; | |
| 22 | |
| 23 // WebMainParts implementation. | |
| 24 void PreMainMessageLoopRun() override; | |
| 25 | |
| 26 // Returns the CWVBrowserState for this embedder. | |
| 27 CWVBrowserState* browser_state() const { return browser_state_.get(); } | |
| 28 | |
| 29 // Returns the off the record CWVBrowserState for this embedder. | |
| 30 CWVBrowserState* off_the_record_browser_state() const { | |
| 31 return off_the_record_browser_state_.get(); | |
| 32 } | |
| 33 | |
| 34 private: | |
| 35 // This object's delegate. | |
| 36 __weak id<CWVDelegate> delegate_; | |
| 37 | |
| 38 // The BrowserState for this embedder. | |
| 39 std::unique_ptr<CWVBrowserState> browser_state_; | |
| 40 | |
| 41 // The BrowserState for this embedder. | |
| 42 std::unique_ptr<CWVBrowserState> off_the_record_browser_state_; | |
| 43 }; | |
| 44 | |
| 45 } // namespace ios_web_view | |
| 46 | |
| 47 #endif // IOS_WEB_VIEW_INTERNAL_CRIWV_WEB_MAIN_PARTS_H_ | |
| OLD | NEW |