Commit 7bf3f1be authored by michaeldo's avatar michaeldo Committed by Commit bot

Ensure framework path is set before any web objects are created.

BUG=none

Review-Url: https://codereview.chromium.org/2750293002
Cr-Commit-Position: refs/heads/master@{#457457}
parent 22169060
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
#import "ios/web_view/internal/web_view_web_main_delegate.h" #import "ios/web_view/internal/web_view_web_main_delegate.h"
#import "base/mac/bundle_locations.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#import "ios/web_view/internal/web_view_web_client.h" #import "ios/web_view/internal/web_view_web_client.h"
#import "ios/web_view/public/cwv_delegate.h" #import "ios/web_view/public/cwv_delegate.h"
#import "ios/web_view/public/cwv_web_view.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -20,6 +22,8 @@ WebViewWebMainDelegate::WebViewWebMainDelegate(id<CWVDelegate> delegate) ...@@ -20,6 +22,8 @@ WebViewWebMainDelegate::WebViewWebMainDelegate(id<CWVDelegate> delegate)
WebViewWebMainDelegate::~WebViewWebMainDelegate() = default; WebViewWebMainDelegate::~WebViewWebMainDelegate() = default;
void WebViewWebMainDelegate::BasicStartupComplete() { void WebViewWebMainDelegate::BasicStartupComplete() {
base::mac::SetOverrideFrameworkBundle(
[NSBundle bundleForClass:[CWVWebView class]]);
web_client_ = base::MakeUnique<WebViewWebClient>(delegate_); web_client_ = base::MakeUnique<WebViewWebClient>(delegate_);
web::SetWebClient(web_client_.get()); web::SetWebClient(web_client_.get());
} }
......
...@@ -7,13 +7,11 @@ ...@@ -7,13 +7,11 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include "base/base_paths.h" #include "base/base_paths.h"
#import "base/mac/bundle_locations.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "components/translate/core/browser/translate_download_manager.h" #include "components/translate/core/browser/translate_download_manager.h"
#include "ios/web_view/internal/web_view_browser_state.h" #include "ios/web_view/internal/web_view_browser_state.h"
#import "ios/web_view/public/cwv_delegate.h" #import "ios/web_view/public/cwv_delegate.h"
#import "ios/web_view/public/cwv_web_view.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
...@@ -30,9 +28,6 @@ WebViewWebMainParts::WebViewWebMainParts(id<CWVDelegate> delegate) { ...@@ -30,9 +28,6 @@ WebViewWebMainParts::WebViewWebMainParts(id<CWVDelegate> delegate) {
WebViewWebMainParts::~WebViewWebMainParts() = default; WebViewWebMainParts::~WebViewWebMainParts() = default;
void WebViewWebMainParts::PreMainMessageLoopRun() { void WebViewWebMainParts::PreMainMessageLoopRun() {
base::mac::SetOverrideFrameworkBundle(
[NSBundle bundleForClass:[CWVWebView class]]);
// Initialize resources. // Initialize resources.
l10n_util::OverrideLocaleWithCocoaLocale(); l10n_util::OverrideLocaleWithCocoaLocale();
ui::ResourceBundle::InitSharedInstanceWithLocale( ui::ResourceBundle::InitSharedInstanceWithLocale(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment