Commit b1416233 authored by Eugene But's avatar Eugene But Committed by Commit Bot

Move web_view_creation_util.* to ios/web/common.

ios/web/common directory contains common code shared between //ios/web
and the rest of the layers (//components, //ios/chrome, //ios/web_view).
This directory does not contain the public API to create and manage web
contents (//ios/web/public is public API directory).

TBR=mrsuyi@chromium.org

Bug: 942244
Change-Id: Idda6ce80f60d8e5a2e5e3e003c37ad5e01d25838
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709661Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Reviewed-by: default avatarJérôme Lebel <jlebel@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679598}
parent 0a0e3b0c
include_rules = [
"+ios/web/common",
"+ios/web/public",
"+third_party/ocmock",
]
......@@ -18,7 +18,8 @@ source_set("browser") {
"//components/prefs",
"//components/signin/core/browser",
"//components/signin/public/base",
"//ios/web",
"//ios/web/common:web_view_creation_util",
"//ios/web/public",
"//url",
]
......
......@@ -19,9 +19,9 @@
#include "components/signin/core/browser/account_reconcilor.h"
#include "components/signin/core/browser/signin_header_helper.h"
#include "components/signin/public/base/account_consistency_method.h"
#include "ios/web/common/web_view_creation_util.h"
#include "ios/web/public/browser_state.h"
#include "ios/web/public/web_state/web_state_policy_decider.h"
#include "ios/web/public/web_view_creation_util.h"
#include "net/base/mac/url_conversions.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "url/gurl.h"
......
......@@ -257,6 +257,7 @@ source_set("app_internal") {
"//ios/public/provider/chrome/browser/user_feedback",
"//ios/testing/perf:startup",
"//ios/third_party/material_roboto_font_loader_ios",
"//ios/web/common:web_view_creation_util",
"//ios/web/public/webui",
"//mojo/core/embedder",
"//net",
......
......@@ -157,11 +157,11 @@
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#import "ios/third_party/material_roboto_font_loader_ios/src/src/MDCTypographyAdditions/MDFRobotoFontLoader+MDCTypographyAdditions.h"
#import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoFontLoader.h"
#import "ios/web/common/web_view_creation_util.h"
#import "ios/web/public/navigation_item.h"
#import "ios/web/public/navigation_manager.h"
#include "ios/web/public/thread/web_task_traits.h"
#import "ios/web/public/web_state/web_state.h"
#import "ios/web/public/web_view_creation_util.h"
#include "ios/web/public/webui/web_ui_ios_controller_factory.h"
#include "mojo/core/embedder/embedder.h"
#import "net/base/mac/url_conversions.h"
......
......@@ -141,6 +141,7 @@ source_set("browser") {
"//ios/public/provider/chrome/browser/voice",
"//ios/web",
"//ios/web/common",
"//ios/web/common:web_view_creation_util",
"//ios/web/public",
"//net",
"//rlz/buildflags",
......
......@@ -72,7 +72,7 @@ source_set("browsing_data") {
"//ios/chrome/browser/webdata_services",
"//ios/net",
"//ios/public/provider/chrome/browser",
"//ios/web",
"//ios/web/common:web_view_creation_util",
"//net",
"//url",
]
......
......@@ -59,10 +59,10 @@
#include "ios/chrome/browser/snapshots/snapshots_util.h"
#include "ios/chrome/browser/webdata_services/web_data_service_factory.h"
#include "ios/net/http_cache_helper.h"
#import "ios/web/common/web_view_creation_util.h"
#import "ios/web/public/browsing_data/browsing_data_removing_util.h"
#include "ios/web/public/thread/web_task_traits.h"
#include "ios/web/public/thread/web_thread.h"
#import "ios/web/public/web_view_creation_util.h"
#import "ios/web/web_state/ui/wk_web_view_configuration_provider.h"
#include "net/base/net_errors.h"
#include "net/cookies/cookie_store.h"
......
......@@ -56,6 +56,7 @@ source_set("flags") {
"//ios/chrome/browser/web:feature_flags",
"//ios/public/provider/chrome/browser",
"//ios/web/common",
"//ios/web/common:web_view_creation_util",
"//ios/web/public",
"//ios/web/public:user_agent",
]
......
......@@ -69,8 +69,8 @@
#include "ios/chrome/grit/ios_strings.h"
#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
#include "ios/web/common/features.h"
#include "ios/web/common/web_view_creation_util.h"
#include "ios/web/public/user_agent.h"
#include "ios/web/public/web_view_creation_util.h"
#if !defined(OFFICIAL_BUILD)
#include "components/variations/variations_switches.h"
......
......@@ -84,6 +84,7 @@ source_set("signin") {
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser/signin",
"//ios/web/common",
"//ios/web/common:web_view_creation_util",
"//net",
"//services/identity:lib",
"//services/service_manager/public/mojom",
......
......@@ -9,7 +9,7 @@
#include "base/json/string_escape.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/web/public/web_view_creation_util.h"
#import "ios/web/common/web_view_creation_util.h"
#import "net/base/mac/url_conversions.h"
#include "net/http/http_request_headers.h"
......
......@@ -27,7 +27,7 @@
#include "ios/chrome/browser/passwords/password_manager_features.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h"
#include "ios/web/public/web_view_creation_util.h"
#include "ios/web/common/web_view_creation_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
......
......@@ -54,7 +54,7 @@ source_set("first_run") {
"//ios/public/provider/chrome/browser/signin",
"//ios/third_party/material_components_ios",
"//ios/third_party/material_roboto_font_loader_ios",
"//ios/web",
"//ios/web/common:web_view_creation_util",
"//ui/base",
"//ui/gfx",
"//url",
......
......@@ -15,7 +15,7 @@
#import "ios/third_party/material_components_ios/src/components/AppBar/src/MDCAppBarViewController.h"
#import "ios/third_party/material_components_ios/src/components/FlexibleHeader/src/MaterialFlexibleHeader.h"
#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h"
#import "ios/web/public/web_view_creation_util.h"
#import "ios/web/common/web_view_creation_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
......
......@@ -14,6 +14,7 @@ source_set("static_content") {
"//base",
"//ios/chrome/browser/browser_state",
"//ios/chrome/browser/url_loading",
"//ios/web/common:web_view_creation_util",
"//ios/web/public/deprecated",
"//net",
"//ui/base",
......
......@@ -15,10 +15,10 @@
#import "ios/chrome/browser/url_loading/url_loading_params.h"
#import "ios/chrome/browser/url_loading/url_loading_service.h"
#import "ios/chrome/browser/url_loading/url_loading_service_factory.h"
#import "ios/web/common/web_view_creation_util.h"
#import "ios/web/public/deprecated/crw_context_menu_delegate.h"
#import "ios/web/public/deprecated/crw_native_content.h"
#import "ios/web/public/navigation_manager.h"
#import "ios/web/public/web_view_creation_util.h"
#import "net/base/mac/url_conversions.h"
#include "ui/base/page_transition_types.h"
#include "ui/base/resource/resource_bundle.h"
......
......@@ -305,7 +305,7 @@ source_set("unit_tests_internal") {
"//ios/chrome/browser/passwords",
"//ios/chrome/browser/web",
"//ios/chrome/test/fakes",
"//ios/web",
"//ios/web/common:web_view_creation_util",
"//ios/web/public/test",
"//ios/web/public/test/fakes",
"//net",
......@@ -413,7 +413,7 @@ source_set("perf_tests") {
"//base/test:test_support",
"//ios/chrome/browser/browser_state:test_support",
"//ios/chrome/test/base:perf_test_support",
"//ios/web",
"//ios/web/common:web_view_creation_util",
"//ios/web/public/test",
]
libs = [ "WebKit.framework" ]
......
......@@ -17,11 +17,11 @@
#include "ios/chrome/browser/chrome_url_constants.h"
#include "ios/chrome/browser/passwords/password_manager_features.h"
#import "ios/chrome/browser/web/error_page_util.h"
#import "ios/web/common/web_view_creation_util.h"
#import "ios/web/public/test/error_test_util.h"
#import "ios/web/public/test/fakes/test_web_state.h"
#import "ios/web/public/test/js_test_util.h"
#include "ios/web/public/test/scoped_testing_web_client.h"
#import "ios/web/public/web_view_creation_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gtest_mac.h"
#include "testing/platform_test.h"
......
......@@ -8,8 +8,8 @@
#include "base/timer/elapsed_timer.h"
#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h"
#include "ios/chrome/test/base/perf_test_ios.h"
#import "ios/web/common/web_view_creation_util.h"
#import "ios/web/public/test/js_test_util.h"
#import "ios/web/public/web_view_creation_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
......
......@@ -72,7 +72,6 @@ source_set("web") {
"network_context_owner.cc",
"url_scheme_util.mm",
"web_client.mm",
"web_view_creation_util.mm",
]
libs = [ "WebKit.framework" ]
......@@ -446,6 +445,7 @@ source_set("ios_web_web_state_unittests") {
"//ios/testing:ocmock_support",
"//ios/web",
"//ios/web/common",
"//ios/web/common:web_view_creation_util",
"//ios/web/find_in_page",
"//ios/web/js_messaging",
"//ios/web/navigation",
......@@ -499,6 +499,7 @@ source_set("ios_web_web_state_js_unittests") {
"//components/url_formatter",
"//ios/net",
"//ios/testing:ocmock_support",
"//ios/web/common:web_view_creation_util",
"//ios/web/find_in_page",
"//ios/web/js_messaging",
"//ios/web/public",
......@@ -618,6 +619,7 @@ test("ios_web_inttests") {
"//ios/testing:http_server_bundle_data",
"//ios/web:resources_grit",
"//ios/web/common",
"//ios/web/common:web_view_creation_util",
"//ios/web/download:download_inttests",
"//ios/web/favicon:inttests",
"//ios/web/js_messaging:inttests",
......
......@@ -10,9 +10,9 @@
#include "base/compiler_specific.h"
#include "base/mac/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "ios/web/common/web_view_creation_util.h"
#include "ios/web/public/browser_state.h"
#import "ios/web/public/test/js_test_util.h"
#import "ios/web/public/web_view_creation_util.h"
#import "ios/web/test/web_int_test.h"
#import "net/base/mac/url_conversions.h"
#include "net/test/embedded_test_server/default_handlers.h"
......
......@@ -31,6 +31,24 @@ source_set("common") {
configs += [ "//build/config/compiler:enable_arc" ]
}
source_set("web_view_creation_util") {
sources = [
"web_view_creation_util.h",
"web_view_creation_util.mm",
]
deps = [
"//base",
"//ios/web/public:user_agent",
"//ios/web/web_state:web_view_internal_creation_util",
"//ios/web/web_state/ui:wk_web_view_configuration_provider",
]
libs = [ "UIKit.framework" ]
configs += [ "//build/config/compiler:enable_arc" ]
}
source_set("unittests") {
configs += [ "//build/config/compiler:enable_arc" ]
testonly = true
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_PUBLIC_WEB_VIEW_CREATION_UTIL_H_
#define IOS_WEB_PUBLIC_WEB_VIEW_CREATION_UTIL_H_
#ifndef IOS_WEB_COMMON_WEB_VIEW_CREATION_UTIL_H_
#define IOS_WEB_COMMON_WEB_VIEW_CREATION_UTIL_H_
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
......@@ -39,4 +39,4 @@ WKWebView* BuildWKWebViewWithCustomContextMenu(
} // web
#endif // IOS_WEB_PUBLIC_WEB_VIEW_CREATION_UTIL_H_
#endif // IOS_WEB_COMMON_WEB_VIEW_CREATION_UTIL_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/web/public/web_view_creation_util.h"
#import "ios/web/common/web_view_creation_util.h"
#include "base/logging.h"
#include "ios/web/public/user_agent.h"
......
......@@ -45,6 +45,7 @@ source_set("unittests") {
"//base",
"//base/test:test_support",
"//crypto",
"//ios/web/common:web_view_creation_util",
"//ios/web/public/js_messaging",
"//ios/web/public/test",
"//ios/web/public/test/fakes",
......
......@@ -6,11 +6,11 @@
#include "base/mac/scoped_block.h"
#include "base/memory/ptr_util.h"
#import "ios/web/common/web_view_creation_util.h"
#include "ios/web/public/test/fakes/test_browser_state.h"
#import "ios/web/public/test/fakes/test_web_client.h"
#include "ios/web/public/test/scoped_testing_web_client.h"
#include "ios/web/public/test/web_test.h"
#import "ios/web/public/web_view_creation_util.h"
#include "third_party/ocmock/OCMock/OCMock.h"
#include "third_party/ocmock/gtest_support.h"
......
......@@ -10,11 +10,11 @@
#include "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "ios/web/common/web_view_creation_util.h"
#include "ios/web/public/test/fakes/test_browser_state.h"
#import "ios/web/public/test/fakes/test_web_client.h"
#import "ios/web/public/test/js_test_util.h"
#include "ios/web/public/test/web_test.h"
#import "ios/web/public/web_view_creation_util.h"
#import "testing/gtest_mac.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
......
......@@ -51,7 +51,6 @@ source_set("public") {
"web_state/web_state_policy_decider.h",
"web_state/web_state_policy_decider_bridge.h",
"web_state/web_state_user_data.h",
"web_view_creation_util.h",
]
libs = [ "WebKit.framework" ]
......
......@@ -10,6 +10,7 @@ source_set("security") {
deps = [
"//base",
"//ios/web/common",
"//ios/web/common:web_view_creation_util",
"//ios/web/js_messaging",
"//ios/web/navigation:core",
"//ios/web/navigation:navigation_manager_util",
......
......@@ -9,11 +9,11 @@
#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/web/common/crw_web_view_content_view.h"
#import "ios/web/common/web_view_creation_util.h"
#import "ios/web/navigation/navigation_manager_impl.h"
#import "ios/web/public/navigation_manager.h"
#include "ios/web/public/reload_type.h"
#import "ios/web/public/security/web_interstitial_delegate.h"
#import "ios/web/public/web_view_creation_util.h"
#import "ios/web/web_state/web_state_impl.h"
#import "net/base/mac/url_conversions.h"
......
......@@ -59,6 +59,7 @@ source_set("test_support") {
"//base",
"//base/test:test_support",
"//ios/web",
"//ios/web/common:web_view_creation_util",
"//ios/web/navigation:core",
"//ios/web/public/test:util",
"//ios/web/public/test/fakes",
......
......@@ -10,10 +10,10 @@
#include "base/path_service.h"
#include "base/scoped_observer.h"
#import "base/test/ios/wait_util.h"
#import "ios/web/common/web_view_creation_util.h"
#import "ios/web/public/test/http_server/http_server.h"
#import "ios/web/public/test/js_test_util.h"
#include "ios/web/public/web_state/web_state_observer.h"
#import "ios/web/public/web_view_creation_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
......
......@@ -8,8 +8,8 @@
#import <WebKit/WebKit.h>
#include "base/logging.h"
#import "ios/web/common/web_view_creation_util.h"
#include "ios/web/public/test/fakes/test_browser_state.h"
#import "ios/web/public/web_view_creation_util.h"
#import "third_party/ocmock/OCMock/NSInvocation+OCMAdditions.h"
#import "third_party/ocmock/OCMock/OCMock.h"
......
......@@ -11,9 +11,9 @@
#include "base/macros.h"
#import "base/test/ios/wait_util.h"
#import "ios/web/common/web_view_creation_util.h"
#import "ios/web/public/test/js_test_util.h"
#include "ios/web/public/test/web_test.h"
#import "ios/web/public/web_view_creation_util.h"
#import "ios/web/web_state/context_menu_constants.h"
#import "net/base/mac/url_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
......
......@@ -8,11 +8,11 @@
#import <WebKit/WebKit.h>
#include "base/memory/ptr_util.h"
#import "ios/web/common/web_view_creation_util.h"
#include "ios/web/public/test/fakes/test_browser_state.h"
#import "ios/web/public/test/fakes/test_web_client.h"
#include "ios/web/public/test/scoped_testing_web_client.h"
#include "ios/web/public/test/web_test.h"
#import "ios/web/public/web_view_creation_util.h"
#import "ios/web/web_state/ui/wk_web_view_configuration_provider.h"
#include "testing/gmock/include/gmock/gmock.h"
#import "testing/gtest_mac.h"
......
......@@ -436,6 +436,7 @@ test("ios_web_view_unittests") {
"//components/signin/public/base:test_support",
"//components/signin/public/identity_manager:test_support",
"//components/sync:test_support",
"//ios/web/common:web_view_creation_util",
"//ios/web/public/deprecated:test_doubles",
"//ios/web/public/js_messaging",
"//ios/web/public/security",
......
......@@ -4,10 +4,10 @@
#include "ios/web_view/internal/web_view_web_client.h"
#import "ios/web/common/web_view_creation_util.h"
#import "ios/web/public/test/js_test_util.h"
#include "ios/web/public/test/scoped_testing_web_client.h"
#include "ios/web/public/test/web_test.h"
#import "ios/web/public/web_view_creation_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gtest_mac.h"
......
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