| 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 #import "ios/web_view/internal/web_view_web_main_delegate.h" | 5 #import "ios/web_view/internal/web_view_web_main_delegate.h" |
| 6 | 6 |
| 7 #import "base/mac/bundle_locations.h" | 7 #import "base/mac/bundle_locations.h" |
| 8 #import "ios/web_view/public/cwv_html_element.h" | |
| 9 | 8 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) | 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 11 #error "This file requires ARC support." | 10 #error "This file requires ARC support." |
| 12 #endif | 11 #endif |
| 13 | 12 |
| 13 // Dummy class used to locate the containing NSBundle. |
| 14 @interface CWVBundleLocator : NSObject |
| 15 @end |
| 16 |
| 17 @implementation CWVBundleLocator |
| 18 @end |
| 19 |
| 14 namespace ios_web_view { | 20 namespace ios_web_view { |
| 15 | 21 |
| 16 WebViewWebMainDelegate::WebViewWebMainDelegate() {} | 22 WebViewWebMainDelegate::WebViewWebMainDelegate() {} |
| 17 | 23 |
| 18 WebViewWebMainDelegate::~WebViewWebMainDelegate() = default; | 24 WebViewWebMainDelegate::~WebViewWebMainDelegate() = default; |
| 19 | 25 |
| 20 void WebViewWebMainDelegate::BasicStartupComplete() { | 26 void WebViewWebMainDelegate::BasicStartupComplete() { |
| 21 // Use CWVHTMLElement instead of CWVWebView and CWVWebViewConfiguration | |
| 22 // because the latter two classes' +intialize calls in to this method and may | |
| 23 // cause a deadlock. | |
| 24 base::mac::SetOverrideFrameworkBundle( | 27 base::mac::SetOverrideFrameworkBundle( |
| 25 [NSBundle bundleForClass:[CWVHTMLElement class]]); | 28 [NSBundle bundleForClass:[CWVBundleLocator class]]); |
| 26 } | 29 } |
| 27 | 30 |
| 28 } // namespace ios_web_view | 31 } // namespace ios_web_view |
| OLD | NEW |