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

Unified Diff: ios/web_view/internal/cwv.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/BUILD.gn ('k') | ios/web_view/internal/cwv_web_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/internal/cwv.mm
diff --git a/ios/web_view/internal/cwv.mm b/ios/web_view/internal/cwv.mm
deleted file mode 100644
index da20ce8b6736cc7a95a0879567a8e90eef19a61d..0000000000000000000000000000000000000000
--- a/ios/web_view/internal/cwv.mm
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "ios/web_view/public/cwv.h"
-
-#include <memory>
-
-#include "base/location.h"
-#import "base/mac/bind_objc_block.h"
-#include "base/memory/ptr_util.h"
-#include "base/single_thread_task_runner.h"
-#include "base/strings/sys_string_conversions.h"
-#include "ios/web/public/app/web_main.h"
-#include "ios/web/public/web_thread.h"
-#import "ios/web_view/internal/web_view_web_main_delegate.h"
-#import "ios/web_view/public/cwv_web_view.h"
-#import "ios/web_view/public/cwv_web_view_configuration.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-namespace {
-CWV* g_criwv = nil;
-}
-
-@interface CWV () {
- std::unique_ptr<ios_web_view::WebViewWebMainDelegate> _webMainDelegate;
- std::unique_ptr<web::WebMain> _webMain;
-}
-@end
-
-@implementation CWV
-
-+ (void)configureWithUserAgentProductName:(NSString*)productName {
- g_criwv = [[CWV alloc] initWithUserAgentProductName:productName];
-}
-
-+ (void)shutDown {
- g_criwv = nil;
-}
-
-+ (CWVWebView*)webViewWithFrame:(CGRect)frame {
- CWVWebViewConfiguration* configuration =
- [CWVWebViewConfiguration defaultConfiguration];
- return [[CWVWebView alloc] initWithFrame:frame configuration:configuration];
-}
-
-- (instancetype)initWithUserAgentProductName:(NSString*)productName {
- self = [super init];
- if (self) {
- std::string userAgent = base::SysNSStringToUTF8(productName);
- _webMainDelegate =
- base::MakeUnique<ios_web_view::WebViewWebMainDelegate>(userAgent);
- web::WebMainParams params(_webMainDelegate.get());
- _webMain = base::MakeUnique<web::WebMain>(params);
- }
- return self;
-}
-
-- (void)dealloc {
- _webMain.reset();
- _webMainDelegate.reset();
-}
-
-@end
« no previous file with comments | « ios/web_view/BUILD.gn ('k') | ios/web_view/internal/cwv_web_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698