Skip to content

Commit

Permalink
Use framework style includes in ios/web_view/public.
Browse files Browse the repository at this point in the history
BUG=704946

Review-Url: https://codereview.chromium.org/2791323002
Cr-Commit-Position: refs/heads/master@{#461494}
  • Loading branch information
michaeldo1 authored and Commit bot committed Apr 3, 2017
1 parent 3e89c40 commit b48b353
Show file tree
Hide file tree
Showing 26 changed files with 94 additions and 189 deletions.
7 changes: 7 additions & 0 deletions build/config/ios/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,12 @@ template("ios_framework_bundle") {
_compile_headers_map_target = _target_name + "_compile_headers_map"
action(_compile_headers_map_target) {
visibility = [ ":$_framework_headers_target" ]
forward_variables_from(invoker,
[
"deps",
"public_deps",
"testonly",
])
script = "//build/config/ios/write_framework_hmap.py"
outputs = [
_header_map_filename,
Expand Down Expand Up @@ -1214,6 +1220,7 @@ template("ios_framework_bundle") {
}

group(_framework_headers_target) {
forward_variables_from(invoker, [ "testonly" ])
deps = [
":$_compile_headers_map_target",
":$_copy_public_headers_target",
Expand Down
77 changes: 60 additions & 17 deletions ios/web_view/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,19 @@ import("//build/config/ios/rules.gni")
import("//tools/grit/repack.gni")

config("config") {
include_dirs = [
"internal",
"public",
defines = [ "CWV_IMPLEMENTATION" ]
libs = [
"CoreGraphics.framework",
"Foundation.framework",
"MobileCoreServices.framework",
"UIKit.framework",
]
}

ios_framework_bundle("web_view") {
output_name = "ChromeWebView"
info_plist = "Info.plist"

sources = [
"public/cwv.h",
"public/cwv_export.h",
]

public_headers = [
"public/ChromeWebView.h",
"public/cwv.h",
Expand All @@ -39,10 +37,57 @@ ios_framework_bundle("web_view") {
"public/cwv_web_view_configuration.h",
]

public = [
"public/ChromeWebView.h",
]

sources = [
"internal/cwv.mm",
"internal/cwv_html_element.mm",
"internal/cwv_html_element_internal.h",
"internal/cwv_navigation_action.mm",
"internal/cwv_navigation_action_internal.h",
"internal/cwv_user_content_controller.mm",
"internal/cwv_user_content_controller_internal.h",
"internal/cwv_user_script.mm",
"internal/cwv_web_view.mm",
"internal/cwv_web_view_configuration.mm",
"internal/cwv_web_view_configuration_internal.h",
"internal/pref_names.cc",
"internal/pref_names.h",
"internal/translate/cwv_translate_manager_impl.h",
"internal/translate/cwv_translate_manager_impl.mm",
"internal/translate/web_view_translate_accept_languages_factory.cc",
"internal/translate/web_view_translate_accept_languages_factory.h",
"internal/translate/web_view_translate_client.h",
"internal/translate/web_view_translate_client.mm",
"internal/web_view_browser_state.h",
"internal/web_view_browser_state.mm",
"internal/web_view_early_page_script_provider.h",
"internal/web_view_early_page_script_provider.mm",
"internal/web_view_java_script_dialog_presenter.h",
"internal/web_view_java_script_dialog_presenter.mm",
"internal/web_view_network_delegate.cc",
"internal/web_view_network_delegate.h",
"internal/web_view_url_request_context_getter.h",
"internal/web_view_url_request_context_getter.mm",
"internal/web_view_web_client.h",
"internal/web_view_web_client.mm",
"internal/web_view_web_main_delegate.h",
"internal/web_view_web_main_delegate.mm",
"internal/web_view_web_main_parts.h",
"internal/web_view_web_main_parts.mm",
"internal/web_view_web_state_policy_decider.h",
"internal/web_view_web_state_policy_decider.mm",
]

sources += public_headers

deps = [
":packed_resources",
"//base",
"//components/infobars/core",
"//components/infobars/core",
"//components/keyed_service/core",
"//components/keyed_service/ios",
"//components/pref_registry",
Expand All @@ -51,25 +96,23 @@ ios_framework_bundle("web_view") {
"//components/translate/core/common",
"//components/translate/ios/browser",
"//ios/net",
"//ios/net",
"//ios/web",
"//ios/web:reload_type",
"//ios/web:user_agent",
"//ios/web:user_agent",
"//ios/web/public/app",
"//ios/web_view/internal",
"//net",
"//net:extras",
"//ui/base",
"//url",
"//url",
]

public_deps = [
"//ios/web_view/public",
configs += [
"//build/config/compiler:enable_arc",
":config",
]

libs = [ "UIKit.framework" ]

public_configs = [ ":config" ]

configs += [ "//build/config/compiler:enable_arc" ]
}

repack("repack_resources") {
Expand Down
71 changes: 0 additions & 71 deletions ios/web_view/internal/BUILD.gn

This file was deleted.

39 changes: 0 additions & 39 deletions ios/web_view/internal/translate/BUILD.gn

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define IOS_WEB_VIEW_INTERNAL_TRANSLATE_WEB_VIEW_TRANSLATE_ACCEPT_LANGUAGES_FACTORY_H_

#include <memory>

#include "base/macros.h"
#include "components/keyed_service/ios/browser_state_keyed_service_factory.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_URL_REQUEST_CONTEXT_GETTER_H_

#include <memory>

#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
Expand Down
1 change: 1 addition & 0 deletions ios/web_view/internal/web_view_web_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_

#include <memory>

#include "base/compiler_specific.h"
#import "ios/web/public/web_client.h"

Expand Down
1 change: 1 addition & 0 deletions ios/web_view/internal/web_view_web_main_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_MAIN_DELEGATE_H_

#include <memory>

#include "base/macros.h"
#include "ios/web/public/app/web_main_delegate.h"

Expand Down
4 changes: 2 additions & 2 deletions ios/web_view/internal/web_view_web_main_parts.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#ifndef IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_MAIN_PARTS_H_
#define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_MAIN_PARTS_H_

#include "ios/web/public/app/web_main_parts.h"

#include <memory>

#include "ios/web/public/app/web_main_parts.h"

@protocol CWVDelegate;

namespace ios_web_view {
Expand Down
28 changes: 0 additions & 28 deletions ios/web_view/public/BUILD.gn

This file was deleted.

9 changes: 6 additions & 3 deletions ios/web_view/public/ChromeWebView.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_WEB_VIEW_PUBLIC_CHROME_WEB_VIEW_H_
#define IOS_WEB_VIEW_PUBLIC_CHROME_WEB_VIEW_H_
#ifndef IOS_WEB_VIEW_PUBLIC_CHROMEWEBVIEW_H_
#define IOS_WEB_VIEW_PUBLIC_CHROMEWEBVIEW_H_

#import <ChromeWebView/cwv.h>
#import <ChromeWebView/cwv_delegate.h>
#import <ChromeWebView/cwv_export.h>
#import <ChromeWebView/cwv_html_element.h>
#import <ChromeWebView/cwv_navigation_action.h>
#import <ChromeWebView/cwv_navigation_delegate.h>
#import <ChromeWebView/cwv_translate_delegate.h>
#import <ChromeWebView/cwv_translate_manager.h>
#import <ChromeWebView/cwv_ui_delegate.h>
#import <ChromeWebView/cwv_user_content_controller.h>
#import <ChromeWebView/cwv_user_script.h>
#import <ChromeWebView/cwv_web_view.h>
#import <ChromeWebView/cwv_web_view_configuration.h>

#endif // IOS_WEB_VIEW_PUBLIC_CHROME_WEB_VIEW_H_
#endif // IOS_WEB_VIEW_PUBLIC_CHROMEWEBVIEW_H_
3 changes: 1 addition & 2 deletions ios/web_view/public/cwv.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
#ifndef IOS_WEB_VIEW_PUBLIC_CWV_H_
#define IOS_WEB_VIEW_PUBLIC_CWV_H_

#import <ChromeWebView/cwv_export.h>
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>

#include "cwv_export.h"

@protocol CWVDelegate;
@class CWVWebView;

Expand Down
2 changes: 1 addition & 1 deletion ios/web_view/public/cwv_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef IOS_WEB_VIEW_PUBLIC_CWV_DELEGATE_H_
#define IOS_WEB_VIEW_PUBLIC_CWV_DELEGATE_H_

#include "cwv_export.h"
#import <ChromeWebView/cwv_export.h>

@class NSString;

Expand Down
3 changes: 1 addition & 2 deletions ios/web_view/public/cwv_html_element.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
#ifndef IOS_WEB_VIEW_PUBLIC_CWV_HTML_ELEMENT_H_
#define IOS_WEB_VIEW_PUBLIC_CWV_HTML_ELEMENT_H_

#import <ChromeWebView/cwv_export.h>
#import <Foundation/Foundation.h>

#include "cwv_export.h"

// Encapsulates information about HTML element. Used in
// delegate methods.
CWV_EXPORT
Expand Down
3 changes: 1 addition & 2 deletions ios/web_view/public/cwv_navigation_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
#ifndef IOS_WEB_VIEW_PUBLIC_CWV_NAVIGATION_ACTION_H_
#define IOS_WEB_VIEW_PUBLIC_CWV_NAVIGATION_ACTION_H_

#import <ChromeWebView/cwv_export.h>
#import <Foundation/Foundation.h>

#include "cwv_export.h"

// Encapsulates information about an action which caused a navigation.
CWV_EXPORT
@interface CWVNavigationAction : NSObject
Expand Down
Loading

0 comments on commit b48b353

Please sign in to comment.