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

Unified Diff: ios/web_view/internal/cwv_web_view.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/cwv.mm ('k') | ios/web_view/internal/cwv_web_view_configuration.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/internal/cwv_web_view.mm
diff --git a/ios/web_view/internal/cwv_web_view.mm b/ios/web_view/internal/cwv_web_view.mm
index 1e199da2baa2178a3c6b38842f95918570f978df..a29d623d9d2bc1d9f2321e5f95f3831bf8fbaff7 100644
--- a/ios/web_view/internal/cwv_web_view.mm
+++ b/ios/web_view/internal/cwv_web_view.mm
@@ -39,7 +39,6 @@ NSString* const kSessionStorageKey = @"sessionStorage";
}
@interface CWVWebView ()<CRWWebStateDelegate, CRWWebStateObserver> {
- CWVWebViewConfiguration* _configuration;
std::unique_ptr<web::WebState> _webState;
std::unique_ptr<web::WebStateDelegateBridge> _webStateDelegate;
std::unique_ptr<web::WebStateObserverBridge> _webStateObserver;
@@ -51,12 +50,16 @@ NSString* const kSessionStorageKey = @"sessionStorage";
_javaScriptDialogPresenter;
}
+// Redefine the property as readwrite.
+@property(nonatomic, copy) CWVWebViewConfiguration* configuration;
// Redefine the property as readwrite to define -setEstimatedProgress:, which
// can be used to send KVO notification.
@property(nonatomic, readwrite) double estimatedProgress;
@end
+static NSString* gUserAgentProduct = nil;
+
@implementation CWVWebView
@synthesize configuration = _configuration;
@@ -65,6 +68,14 @@ NSString* const kSessionStorageKey = @"sessionStorage";
@synthesize estimatedProgress = _estimatedProgress;
@synthesize UIDelegate = _UIDelegate;
++ (NSString*)userAgentProduct {
+ return gUserAgentProduct;
+}
+
++ (void)setUserAgentProduct:(NSString*)product {
+ gUserAgentProduct = [product copy];
+}
+
- (instancetype)initWithFrame:(CGRect)frame
configuration:(CWVWebViewConfiguration*)configuration {
self = [super initWithFrame:frame];
« no previous file with comments | « ios/web_view/internal/cwv.mm ('k') | ios/web_view/internal/cwv_web_view_configuration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698