Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(680)

Unified Diff: ios/web_view/internal/web_view_web_client.mm

Issue 2791403005: Remove CWV class and move setting User Agent to CWVWebViewConfiguration. (Closed)
Patch Set: Rebase. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web_view/internal/web_view_web_client.h ('k') | ios/web_view/internal/web_view_web_main_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/internal/web_view_web_client.mm
diff --git a/ios/web_view/internal/web_view_web_client.mm b/ios/web_view/internal/web_view_web_client.mm
index a9c60a05d0ff75b889784b9d4d94aec7c0e5086e..319b5e32e24516c62bcb8a0e38e1b5f5d388891c 100644
--- a/ios/web_view/internal/web_view_web_client.mm
+++ b/ios/web_view/internal/web_view_web_client.mm
@@ -4,10 +4,12 @@
#import "ios/web_view/internal/web_view_web_client.h"
+#include "base/strings/sys_string_conversions.h"
#include "ios/web/public/user_agent.h"
#include "ios/web_view/internal/web_view_browser_state.h"
#import "ios/web_view/internal/web_view_early_page_script_provider.h"
#import "ios/web_view/internal/web_view_web_main_parts.h"
+#include "ios/web_view/public/cwv_web_view.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
@@ -15,8 +17,7 @@
namespace ios_web_view {
-WebViewWebClient::WebViewWebClient(const std::string& user_agent_product)
- : user_agent_product_(user_agent_product), web_main_parts_(nullptr) {}
+WebViewWebClient::WebViewWebClient() : web_main_parts_(nullptr) {}
WebViewWebClient::~WebViewWebClient() = default;
@@ -25,16 +26,8 @@ web::WebMainParts* WebViewWebClient::CreateWebMainParts() {
return web_main_parts_;
}
-WebViewBrowserState* WebViewWebClient::browser_state() const {
- return web_main_parts_->browser_state();
-}
-
-WebViewBrowserState* WebViewWebClient::off_the_record_browser_state() const {
- return web_main_parts_->off_the_record_browser_state();
-}
-
std::string WebViewWebClient::GetProduct() const {
- return user_agent_product_;
+ return base::SysNSStringToUTF8([CWVWebView userAgentProduct]);
}
std::string WebViewWebClient::GetUserAgent(web::UserAgentType type) const {
« no previous file with comments | « ios/web_view/internal/web_view_web_client.h ('k') | ios/web_view/internal/web_view_web_main_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698