Chromium Code Reviews| 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_CLIENT_H_ | 5 #ifndef IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_ |
| 6 #define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_ | 6 #define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #import "ios/web/public/web_client.h" | 11 #import "ios/web/public/web_client.h" |
| 12 | 12 |
| 13 @protocol CWVDelegate; | |
| 14 | |
| 15 namespace ios_web_view { | 13 namespace ios_web_view { |
| 16 class WebViewBrowserState; | 14 class WebViewBrowserState; |
| 17 class WebViewWebMainParts; | 15 class WebViewWebMainParts; |
| 18 | 16 |
| 19 // WebView implementation of WebClient. | 17 // WebView implementation of WebClient. |
| 20 class WebViewWebClient : public web::WebClient { | 18 class WebViewWebClient : public web::WebClient { |
| 21 public: | 19 public: |
| 22 explicit WebViewWebClient(id<CWVDelegate> delegate); | 20 explicit WebViewWebClient(std::string user_agent_product); |
|
Eugene But (OOO till 7-30)
2017/04/04 18:34:38
const std::string&
michaeldo
2017/04/04 21:24:28
Done.
| |
| 23 ~WebViewWebClient() override; | 21 ~WebViewWebClient() override; |
| 24 | 22 |
| 25 // WebClient implementation. | 23 // WebClient implementation. |
| 26 web::WebMainParts* CreateWebMainParts() override; | 24 web::WebMainParts* CreateWebMainParts() override; |
| 27 std::string GetProduct() const override; | 25 std::string GetProduct() const override; |
| 28 std::string GetUserAgent(web::UserAgentType type) const override; | 26 std::string GetUserAgent(web::UserAgentType type) const override; |
| 29 NSString* GetEarlyPageScript(web::BrowserState* browser_state) const override; | 27 NSString* GetEarlyPageScript(web::BrowserState* browser_state) const override; |
| 30 | 28 |
| 31 // Normal browser state associated with the receiver. | 29 // Normal browser state associated with the receiver. |
| 32 WebViewBrowserState* browser_state() const; | 30 WebViewBrowserState* browser_state() const; |
| 33 // Off the record browser state associated with the receiver. | 31 // Off the record browser state associated with the receiver. |
| 34 WebViewBrowserState* off_the_record_browser_state() const; | 32 WebViewBrowserState* off_the_record_browser_state() const; |
| 35 | 33 |
| 36 private: | 34 private: |
| 37 // This object's delegate. | 35 // The name of the product to be used in the User Agent string. |
| 38 __weak id<CWVDelegate> delegate_; | 36 std::string user_agent_product_; |
| 39 | 37 |
| 40 // The WebMainParts created by |CreateWebMainParts()|. | 38 // The WebMainParts created by |CreateWebMainParts()|. |
| 41 WebViewWebMainParts* web_main_parts_; | 39 WebViewWebMainParts* web_main_parts_; |
| 42 | 40 |
| 43 DISALLOW_COPY_AND_ASSIGN(WebViewWebClient); | 41 DISALLOW_COPY_AND_ASSIGN(WebViewWebClient); |
| 44 }; | 42 }; |
| 45 | 43 |
| 46 } // namespace ios_web_view | 44 } // namespace ios_web_view |
| 47 | 45 |
| 48 #endif // IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_ | 46 #endif // IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_ |
| OLD | NEW |