| Index: ios/web/web_state/web_view_internal_creation_util.mm
|
| diff --git a/ios/web/web_state/web_view_internal_creation_util.mm b/ios/web/web_state/web_view_internal_creation_util.mm
|
| index 5095110ff5225cd65dde288949e61442d8614181..937a6f61dc9f6993c982c8c2fa7b65af0820764a 100644
|
| --- a/ios/web/web_state/web_view_internal_creation_util.mm
|
| +++ b/ios/web/web_state/web_view_internal_creation_util.mm
|
| @@ -7,12 +7,15 @@
|
| #import <objc/runtime.h>
|
|
|
| #include "base/logging.h"
|
| -#import "base/mac/scoped_nsobject.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| #import "ios/web/public/web_client.h"
|
| #import "ios/web/web_state/ui/crw_context_menu_controller.h"
|
| #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h"
|
|
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| namespace web {
|
|
|
| namespace {
|
| @@ -60,17 +63,17 @@ WKWebView* BuildWKWebView(CGRect frame,
|
| web_view.allowsLinkPreview = NO;
|
|
|
| if (context_menu_delegate) {
|
| - base::scoped_nsobject<CRWContextMenuController> context_menu_controller(
|
| - [[CRWContextMenuController alloc]
|
| - initWithWebView:web_view
|
| - injectionEvaluator:nil
|
| - delegate:context_menu_delegate]);
|
| - objc_setAssociatedObject(web_view, context_menu_controller.get(),
|
| - context_menu_controller.get(),
|
| + CRWContextMenuController* context_menu_controller = [
|
| + [CRWContextMenuController alloc] initWithWebView:web_view
|
| + injectionEvaluator:nil
|
| + delegate:context_menu_delegate];
|
| + void* associatedObjectKey = (__bridge void*)context_menu_controller;
|
| + objc_setAssociatedObject(web_view, associatedObjectKey,
|
| + context_menu_controller,
|
| OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
| }
|
|
|
| - return [web_view autorelease];
|
| + return web_view;
|
| }
|
|
|
| WKWebView* BuildWKWebView(CGRect frame,
|
|
|