| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_MAIN_PARTS_H_ | 5 #ifndef IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_MAIN_PARTS_H_ |
| 6 #define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_MAIN_PARTS_H_ | 6 #define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_MAIN_PARTS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ios/web/public/app/web_main_parts.h" | 10 #include "ios/web/public/app/web_main_parts.h" |
| 11 | 11 |
| 12 @protocol CWVDelegate; | 12 @protocol CWVDelegate; |
| 13 | 13 |
| 14 namespace ios_web_view { | 14 namespace ios_web_view { |
| 15 class WebViewBrowserState; | |
| 16 | 15 |
| 17 // WebView implementation of WebMainParts. | 16 // WebView implementation of WebMainParts. |
| 18 class WebViewWebMainParts : public web::WebMainParts { | 17 class WebViewWebMainParts : public web::WebMainParts { |
| 19 public: | 18 public: |
| 20 WebViewWebMainParts(); | 19 WebViewWebMainParts(); |
| 21 ~WebViewWebMainParts() override; | 20 ~WebViewWebMainParts() override; |
| 22 | 21 |
| 23 // WebMainParts implementation. | 22 // WebMainParts implementation. |
| 24 void PreMainMessageLoopRun() override; | 23 void PreMainMessageLoopRun() override; |
| 25 | |
| 26 // Returns the WebViewBrowserState for this embedder. | |
| 27 WebViewBrowserState* browser_state() const { return browser_state_.get(); } | |
| 28 | |
| 29 // Returns the off the record WebViewBrowserState for this embedder. | |
| 30 WebViewBrowserState* off_the_record_browser_state() const { | |
| 31 return off_the_record_browser_state_.get(); | |
| 32 } | |
| 33 | |
| 34 private: | |
| 35 // The BrowserState for this embedder. | |
| 36 std::unique_ptr<WebViewBrowserState> browser_state_; | |
| 37 | |
| 38 // Off The Record BrowserState for this embedder. | |
| 39 std::unique_ptr<WebViewBrowserState> off_the_record_browser_state_; | |
| 40 }; | 24 }; |
| 41 | 25 |
| 42 } // namespace ios_web_view | 26 } // namespace ios_web_view |
| 43 | 27 |
| 44 #endif // IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_MAIN_PARTS_H_ | 28 #endif // IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_MAIN_PARTS_H_ |
| OLD | NEW |