diff options
42 files changed, 1385 insertions, 83 deletions
@@ -292,7 +292,6 @@ v8.log /third_party/mesa/src /third_party/mingw-w64 /third_party/mkl -/third_party/mt19937ar /third_party/nacl_sdk_binaries/ /third_party/nss /third_party/openmax_dl/ @@ -60,6 +60,7 @@ group("root") { "//third_party/icu", "//third_party/leveldatabase", "//third_party/libaddressinput", + "//third_party/libphonenumber", "//third_party/libpng", "//third_party/libsrtp", "//third_party/libusb", diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index 9e9c88f..b0a8ab4 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -32,12 +32,9 @@ config("feature_flags") { defines = [ "CHROMIUM_BUILD", "ENABLE_ONE_CLICK_SIGNIN", - "ENABLE_REMOTING=1", "ENABLE_NOTIFICATIONS", "ENABLE_EGLIMAGE=1", "ENABLE_BACKGROUND=1", - "ENABLE_GOOGLE_NOW=1", - "ENABLE_SETTINGS_APP=1", "USE_MOJO=1", "V8_DEPRECATION_WARNINGS", # Don't use deprecated V8 APIs anywhere. # Temporary suppression until Blink code can be removed. @@ -160,6 +157,9 @@ config("feature_flags") { if (enable_app_list) { defines += [ "ENABLE_APP_LIST=1" ] } + if (enable_settings_app) { + defines += [ "ENABLE_SETTINGS_APP=1" ] + } if (enable_managed_users) { defines += [ "ENABLE_MANAGED_USERS=1" ] } @@ -172,6 +172,15 @@ config("feature_flags") { if (enable_wifi_bootstrapping) { defines += [ "ENABLE_WIFI_BOOTSTRAPPING=1" ] } + if (enable_image_loader_extension) { + defines += [ "IMAGE_LOADER_EXTENSION=1" ] + } + if (enable_remoting) { + defines += [ "ENABLE_REMOTING=1" ] + } + if (enable_google_now) { + defines += [ "ENABLE_GOOGLE_NOW=1" ] + } } # Debug/release ---------------------------------------------------------------- diff --git a/build/config/features.gni b/build/config/features.gni index 333f8d3..07fd5a9 100644 --- a/build/config/features.gni +++ b/build/config/features.gni @@ -128,6 +128,7 @@ enable_rlz = is_chrome_branded && (is_win || is_mac || is_ios || is_chromeos) enable_plugin_installation = is_win || is_mac enable_app_list = !is_ios && !is_android +enable_settings_app = enable_app_list && !is_chromeos enable_managed_users = !is_ios @@ -136,3 +137,10 @@ enable_service_discovery = enable_mdns || is_mac enable_autofill_dialog = !is_ios && !(is_android && is_android_webview_build) enable_wifi_bootstrapping = is_win || is_mac + +# Image loader extension is enabled on ChromeOS only. +enable_image_loader_extension = is_chromeos + +enable_remoting = !is_ios && !is_android + +enable_google_now = !is_ios && !is_android diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn index bc5bde3..8939ad8 100644 --- a/build/config/linux/BUILD.gn +++ b/build/config/linux/BUILD.gn @@ -56,6 +56,10 @@ pkg_config("dbus") { packages = [ "dbus-1" ] } +pkg_config("gnome_keyring") { + packages = [ "gnome-keyring-1" ] +} + if (use_evdev_gestures) { pkg_config("libevdev-cros") { packages = [ "libevdev-cros" ] @@ -95,6 +99,10 @@ config("xrandr") { libs = [ "xrandr" ] } +config("xscrnsaver") { + libs = [ "Xss" ] +} + config("libcap") { libs = [ "cap" ] } diff --git a/build/json_schema_compile.gypi b/build/json_schema_compile.gypi index 3c4e7c6..1f94b46 100644 --- a/build/json_schema_compile.gypi +++ b/build/json_schema_compile.gypi @@ -17,8 +17,7 @@ }, 'rules': [ { - # GN version: //build/json_schema.gni - # (json_schema_compile template) + # GN version: //extensions/generated_extensions_api.gni 'rule_name': 'genapi', 'msvs_external_rule': 1, 'extension': 'json', diff --git a/build/secondary/tools/grit/grit_rule.gni b/build/secondary/tools/grit/grit_rule.gni index 150615c..7d42224 100644 --- a/build/secondary/tools/grit/grit_rule.gni +++ b/build/secondary/tools/grit/grit_rule.gni @@ -25,11 +25,30 @@ # # You can also put deps here if the grit source depends on generated # # files. # } +import ("//build/config/crypto.gni") import ("//build/config/features.gni") import ("//build/config/ui.gni") grit_defines = [] +# Mac and iOS want Title Case strings. +use_titlecase_in_grd_files = is_mac || is_ios +if (use_titlecase_in_grd_files) { + grit_defines += [ "-D", "use_titlecase" ] +} + +if (is_chrome_branded) { + grit_defines += [ + "-D", "_google_chrome", + "-E", "CHROMIUM_BUILD=google_chrome", + ] +} else { + grit_defines += [ + "-D", "_chromium", + "-E", "CHROMIUM_BUILD=chromium", + ] +} + if (is_chromeos) { grit_defines += [ "-D", "chromeos", @@ -41,6 +60,34 @@ if (is_desktop_linux) { grit_defines += [ "-D", "desktop_linux" ] } +if (toolkit_views) { + grit_defines += [ "-D", "toolkit_views" ] +} + +if (use_aura) { + grit_defines += [ "-D", "use_aura" ] +} + +if (use_ash) { + grit_defines += [ "-D", "use_ash" ] +} + +if (use_nss_certs) { + grit_defines += [ "-D", "use_nss" ] +} + +if (use_ozone) { + grit_defines += [ "-D", "use_ozone" ] +} + +if (enable_image_loader_extension) { + grit_defines += [ "-D", "image_loader_extension" ] +} + +if (enable_remoting) { + grit_defines += [ "-D", "remoting" ] +} + if (is_android) { grit_defines += [ "-t", "android", @@ -48,26 +95,61 @@ if (is_android) { ] } +if (is_mac || is_ios) { + grit_defines += [ "-D", "scale_factors=2x" ] +} + +if (is_ios) { + grit_defines += [ + "-t", "ios", + # iOS uses a whitelist to filter resources. + "-w", rebase_path("//build/ios/grit_whitelist.txt", root_build_dir), + ] +} + if (enable_extensions) { grit_defines += [ "-D", "enable_extensions" ] } if (enable_plugins) { grit_defines += [ "-D", "enable_plugins" ] } -if (enable_task_manager) { - grit_defines += [ "-D", "enable_task_manager" ] +if (enable_printing != 0) { + grit_defines += [ "-D", "enable_printing" ] + if (enable_printing == 1) { + grit_defines += [ "-D", "enable_full_printing" ] + } +} +if (enable_themes) { + grit_defines += [ "-D", "enable_themes" ] } if (enable_app_list) { grit_defines += [ "-D", "enable_app_list" ] } -if (enable_service_discovery) { - grit_defines += [ "-D", "enable_service_discovery" ] +if (enable_settings_app) { + grit_defines += [ "-D", "enable_settings_app" ] +} +if (enable_google_now) { + grit_defines += [ "-D", "enable_google_now" ] +} +# Note: use_concatenated_impulse_responses is omitted. It is never used and +# should probably be removed from GYP build. +if (enable_webrtc) { + grit_defines += [ "-D", "enable_webrtc" ] +} +# Note: enable_hangout_services_extension is omitted. It is never set in the +# GYP build. Need to figure out what it's for. +if (enable_task_manager) { + grit_defines += [ "-D", "enable_task_manager" ] +} +if (enable_notifications) { + grit_defines += [ "-D", "enable_notifications" ] } if (enable_wifi_bootstrapping) { grit_defines += [ "-D", "enable_wifi_bootstrapping" ] } - -# TODO(GYP) the rest of the grit_defines from the gyp build. +if (enable_service_discovery) { + grit_defines += [ "-D", "enable_service_discovery" ] +} grit_resource_id_file = "//tools/gritsettings/resource_ids" grit_info_script = "//tools/grit/grit_info.py" diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 0d54531..852cf11 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn @@ -40,7 +40,16 @@ static_library("browser") { "//chrome/browser/search/suggestions/proto", "//chrome/common", "//chrome/common/net", + "//components/cloud_devices/common", + "//components/metrics:net", + "//components/navigation_metrics", + "//components/os_crypt", + "//components/policy:policy_component", + "//components/query_parser", "//components/strings", + "//components/translate:translate_core_browser", + "//components/translate:translate_core_common", + "//components/user_prefs", "//content/public/browser", "//content/public/common", "//crypto", @@ -69,8 +78,6 @@ static_library("browser") { #"../components/components.gyp:autofill_core_browser", #"../components/components.gyp:bookmarks_browser", #"../components/components.gyp:captive_portal", - #"../components/components.gyp:cloud_devices_common", - #"../components/components.gyp:component_metrics_proto", #"../components/components.gyp:data_reduction_proxy_browser", #"../components/components.gyp:domain_reliability", #"../components/components.gyp:favicon_base", @@ -82,31 +89,18 @@ static_library("browser") { #"../components/components.gyp:history_core_common", #"../components/components.gyp:infobars_core", #"../components/components.gyp:invalidation", - #"../components/components.gyp:metrics", - #"../components/components.gyp:metrics_net", - #"../components/components.gyp:navigation_metrics", #"../components/components.gyp:network_time", #"../components/components.gyp:omaha_query_params", - #"../components/components.gyp:os_crypt", #"../components/components.gyp:password_manager_core_browser", #"../components/components.gyp:password_manager_core_common", - #"../components/components.gyp:policy_component", #"../components/components.gyp:precache_core", - #"../components/components.gyp:query_parser", #"../components/components.gyp:rappor", #"../components/components.gyp:search_engines", #"../components/components.gyp:search_provider_logos", #"../components/components.gyp:signin_core_browser", #"../components/components.gyp:startup_metric_utils", #"../components/components.gyp:sync_driver", - #"../components/components.gyp:translate_core_browser", - #"../components/components.gyp:translate_core_common", #"../components/components.gyp:url_fixer", - #"../components/components.gyp:user_prefs", - ## This depends directly on the variations target, rather than just - ## transitively via the common target because the proto sources need to - ## be generated before code in this target can start building. - #"../components/components.gyp:variations", #"../components/components.gyp:webdata_common", #"../courgette/courgette.gyp:courgette_lib", #"../google_apis/google_apis.gyp:google_apis", @@ -114,6 +108,9 @@ static_library("browser") { #"../third_party/libjingle/libjingle.gyp:libjingle", #"../ui/message_center/message_center.gyp:message_center", #"../ui/shell_dialogs/shell_dialogs.gyp:shell_dialogs", + # Note: variations dependency from GYP build is omitted because we pick it + # up via chrome/common, and GN doesn't have the GYP dependency bug that + # made it necessary to include here. ] forward_dependent_configs_from = [ @@ -144,25 +141,29 @@ static_library("browser") { deps += [ "//cc", + "//chrome/browser/performance_monitor", + "//components/keyed_service/content", + "//components/url_matcher", "//components/visitedlink/browser", "//components/visitedlink/common", "//net:net_with_v8", "//third_party/adobe/flash:flapper_version_h", "//third_party/expat", "//third_party/leveldatabase", + "//third_party/libaddressinput", "//third_party/libyuv", "//third_party/npapi", "//third_party/re2", "//third_party/smhasher:cityhash", "//ui/gl", "//ui/surface", + "//v8", "//webkit:resources", "//webkit/browser:storage", "//webkit/common", "//webkit/common:storage", # TODO(GYP) #"apps", - #"browser/performance_monitor/performance_monitor.gyp:performance_monitor", #"browser_extensions", #"common/extensions/api/api.gyp:chrome_api", #"debugger", @@ -171,14 +172,12 @@ static_library("browser") { #"sync_file_system_proto", #"../components/components.gyp:autofill_content_browser", #"../components/components.gyp:dom_distiller_content", - #"../components/components.gyp:keyed_service_content", #"../components/components.gyp:navigation_interception", #"../components/components.gyp:password_manager_content_browser", #"../components/components.gyp:precache_content", #"../components/components.gyp:sessions", #"../components/components.gyp:storage_monitor", #"../components/components.gyp:translate_content_browser", - #"../components/components.gyp:url_matcher", #"../components/components.gyp:usb_service", #"../components/components.gyp:web_modal", #"../media/cast/cast.gyp:cast_transport", @@ -189,11 +188,9 @@ static_library("browser") { #"../mojo/mojo.gyp:mojo_system_impl", ## TODO(tonyg): Remove this dependency (crbug.com/280157). #"../testing/perf/perf_test.gyp:*", - #"../third_party/libaddressinput/libaddressinput.gyp:libaddressinput", # Note: for this one also remove the webrtc_stub_config #"../third_party/webrtc/modules/modules.gyp:desktop_capture", #"../ui/web_dialogs/web_dialogs.gyp:web_dialogs", - #"../v8/tools/gyp/v8.gyp:v8", ] } else { # iOS sources += rebase_path(gypi_values.chrome_browser_ios_sources, @@ -316,8 +313,8 @@ static_library("browser") { gypi_values.chrome_browser_basic_safe_browsing_sources, ".", "//chrome") deps += [ - #"safe_browsing_chunk_proto", TODO(GYP) - #"safe_browsing_report_proto", TODO(GYP) + "//chrome/browser/safe_browsing:chunk_proto", + "//chrome/browser/safe_browsing:report_proto", ] if (safe_browsing_mode == 1) { sources += rebase_path( @@ -325,7 +322,7 @@ static_library("browser") { ".", "//chrome") defines += [ "FULL_SAFE_BROWSING" ] deps += [ - #"safe_browsing_proto", TODO(GYP) + "//chrome/common/safe_browsing:proto", ] } else if (safe_browsing_mode == 2) { defines += [ "MOBILE_SAFE_BROWSING" ] @@ -358,14 +355,14 @@ static_library("browser") { if (is_desktop_linux) { sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources, ".", "//chrome") - #deps += [ "../build/linux/system.gyp:gnome_keyring" ] TODO(GYP) + configs += [ "//build/config/linux:gnome_keyring" ] } if (use_aura) { sources += rebase_path(gypi_values.chrome_browser_aura_sources, ".", "//chrome") deps += [ - #"../ui/aura/aura.gyp:aura", TODO(GYP) - #"../ui/compositor/compositor.gyp:compositor", TODO(GYP) + "//ui/aura", + "//ui/compositor", #"../ui/keyboard/keyboard.gyp:keyboard", TODO(GYP) ] } @@ -377,9 +374,7 @@ static_library("browser") { sources += rebase_path(gypi_values.chrome_browser_x11_sources, ".", "//chrome") if (!is_chromeos) { - deps += [ - # "../build/linux/system.gyp:xscrnsaver", TODO(GYP) - ] + configs += [ "//build/config/linux:xscrnsaver" ] } } if (is_posix && !is_mac && !is_ios) { @@ -460,11 +455,11 @@ static_library("browser") { #"chrome_browser_jni_headers", TODO(GYP) ] deps -= [ + "//third_party/libaddressinput", #"../components/components.gyp:feedback_component", TODO(GYP) #"../components/components.gyp:storage_monitor", TODO(GYP) #"../components/components.gyp:usb_service", TODO(GYP) #"../components/components.gyp:web_modal", TODO(GYP) - #"../third_party/libaddressinput/libaddressinput.gyp:libaddressinput", TODO(GYP) ] } else { sources += rebase_path(gypi_values.chrome_browser_non_android_sources, diff --git a/chrome/browser/performance_monitor/BUILD.gn b/chrome/browser/performance_monitor/BUILD.gn new file mode 100644 index 0000000..0439566 --- /dev/null +++ b/chrome/browser/performance_monitor/BUILD.gn @@ -0,0 +1,10 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//extensions/generated_extensions_api.gni") + +generated_extensions_api("performance_monitor") { + sources = [ "events.json" ] + root_namespace = "performance_monitor" +} diff --git a/chrome/browser/safe_browsing/BUILD.gn b/chrome/browser/safe_browsing/BUILD.gn new file mode 100644 index 0000000..b6c750e --- /dev/null +++ b/chrome/browser/safe_browsing/BUILD.gn @@ -0,0 +1,15 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: chrome/chrome_browser.gypi:safe_browsing_chunk_proto +proto_library("chunk_proto") { + sources = [ "chunk.proto" ] +} + +# GYP version: chrome/chrome_browser.gypi:safe_browsing_report_proto +proto_library("report_proto") { + sources = [ "report.proto" ] +} diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 6aafbf6..f433ecd 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3448,6 +3448,7 @@ { # Protobuf compiler / generator for the safebrowsing chunk # protocol buffer. + # GN version: //chrome/browser/safe_browsing:chunk_proto 'target_name': 'safe_browsing_chunk_proto', 'type': 'static_library', 'sources': [ 'browser/safe_browsing/chunk.proto' ], @@ -3460,6 +3461,7 @@ { # Protobuf compiler / generator for the safebrowsing reporting # protocol buffer. + # GN version: //chrome/browser/safe_browsing:report_proto 'target_name': 'safe_browsing_report_proto', 'type': 'static_library', 'sources': [ 'browser/safe_browsing/report.proto' ], diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index 7f9538c..fa43381 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn @@ -45,7 +45,7 @@ static_library("common") { "//components/metrics", #"//components/components.gyp:policy_component_common", TODO(GYP) "//components/translate:translate_core_common", - #"//components/variations", TODO(GYP) + "//components/variations", "//content/public/common", "//crypto", "//extensions:extensions_resources", diff --git a/chrome/common/extensions/api/BUILD.gn b/chrome/common/extensions/api/BUILD.gn index 2432763..4734470 100644 --- a/chrome/common/extensions/api/BUILD.gn +++ b/chrome/common/extensions/api/BUILD.gn @@ -36,6 +36,7 @@ generated_extensions_api("api") { impl_dir = "//chrome/browser/extensions/api" root_namespace = "extensions::api" + bundle = true deps = [ # Different APIs include some headers from chrome/common that in turn diff --git a/components/BUILD.gn b/components/BUILD.gn index 319d55d..b2b0c5e 100644 --- a/components/BUILD.gn +++ b/components/BUILD.gn @@ -8,6 +8,9 @@ group("all_components") { visibility = "//:*" # Only for the root targets to bring in. deps = [ + "//components/autofill/content/browser", + "//components/autofill/content/common", + "//components/autofill/content/renderer", "//components/cloud_devices/common", "//components/dom_distiller/core", "//components/favicon_base", @@ -17,6 +20,7 @@ group("all_components") { "//components/navigation_metrics", "//components/onc", "//components/os_crypt", + "//components/policy", "//components/pref_registry", "//components/query_parser", "//components/resources:components_resources", @@ -27,6 +31,7 @@ group("all_components") { "//components/translate:translate_core_common", "//components/url_matcher", "//components/user_prefs", + "//components/variations", "//components/visitedlink/browser", "//components/visitedlink/common", "//components/visitedlink/renderer", # Blocked on blink @@ -44,10 +49,14 @@ group("all_components") { if (is_android) { deps -= [ + "//components/autofill/content/browser", # Blocked on content/blink. + "//components/autofill/content/common", # Blocked on content. + "//components/autofill/content/renderer", # Blocked on content/blink. "//components/cloud_devices/common", # Should work, needs checking. "//components/dom_distiller/core", # Blocked on content. "//components/json_schema", # Should work, needs checking. "//components/keyed_service/content", # Blocked on content. + "//components/policy", # Blocked on content (indirectly via autofill). "//components/user_prefs", # Blocked on content. "//components/visitedlink/browser", # Blocked on content. "//components/visitedlink/common", # Blocked on content. diff --git a/components/autofill.gypi b/components/autofill.gypi index eac417e..1311387 100644 --- a/components/autofill.gypi +++ b/components/autofill.gypi @@ -6,6 +6,7 @@ 'targets': [ { # Private target only used in components/autofill. + # GN version: //components/autofill/core/browser:regexes 'target_name': 'autofill_regexes', 'type': 'none', 'actions': [{ @@ -24,6 +25,7 @@ }, { + # GN version: //components/autofill/core/common 'target_name': 'autofill_core_common', 'type': 'static_library', 'dependencies': [ @@ -82,6 +84,7 @@ }, { + # GN version: //components/autofill/core/browser 'target_name': 'autofill_core_browser', 'type': 'static_library', 'include_dirs': [ @@ -245,6 +248,7 @@ }, { + # GN version: //components/autofill/core/browser:test_support 'target_name': 'autofill_core_test_support', 'type': 'static_library', 'dependencies': [ @@ -275,6 +279,7 @@ ['OS != "ios"', { 'targets': [ { + # GN version: //content/autofill/content/common 'target_name': 'autofill_content_common', 'type': 'static_library', 'dependencies': [ @@ -299,6 +304,7 @@ { # Protobuf compiler / generate rule for Autofill's risk integration. + # GN version: //components/autofill/content/browser:risk_proto 'target_name': 'autofill_content_risk_proto', 'type': 'static_library', 'sources': [ @@ -311,6 +317,7 @@ 'includes': [ '../build/protoc.gypi' ] }, { + # GN version: //components/autofill/content/browser:test_support 'target_name': 'autofill_content_test_support', 'type': 'static_library', 'dependencies': [ @@ -325,6 +332,7 @@ 'include_dirs': [ '..' ], }, { + # GN version: //components/autofill/content/browser 'target_name': 'autofill_content_browser', 'type': 'static_library', 'include_dirs': [ @@ -403,6 +411,7 @@ }, { + # GN version: //components/autofill/content/renderer 'target_name': 'autofill_content_renderer', 'type': 'static_library', 'include_dirs': [ diff --git a/components/autofill/content/browser/BUILD.gn b/components/autofill/content/browser/BUILD.gn new file mode 100644 index 0000000..572afcd --- /dev/null +++ b/components/autofill/content/browser/BUILD.gn @@ -0,0 +1,88 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: components/autofill.gypi:autofill_content_browser +static_library("browser") { + sources = [ + "content_autofill_driver.cc", + "content_autofill_driver.h", + "request_autocomplete_manager.cc", + "request_autocomplete_manager.h", + "risk/fingerprint.cc", + "risk/fingerprint.h", + "wallet/form_field_error.cc", + "wallet/form_field_error.h", + "wallet/full_wallet.cc", + "wallet/full_wallet.h", + "wallet/gaia_account.cc", + "wallet/gaia_account.h", + "wallet/instrument.cc", + "wallet/instrument.h", + "wallet/required_action.cc", + "wallet/required_action.h", + "wallet/wallet_address.cc", + "wallet/wallet_address.h", + "wallet/wallet_client.cc", + "wallet/wallet_client.h", + "wallet/wallet_client_delegate.h", + "wallet/wallet_items.cc", + "wallet/wallet_items.h", + "wallet/wallet_service_url.cc", + "wallet/wallet_service_url.h", + "wallet/wallet_signin_helper.cc", + "wallet/wallet_signin_helper.h", + ] + + deps = [ + ":risk_proto", + "//base", + "//base:i18n", + "//base:prefs", + "//components/autofill/content/common", + "//components/autofill/core/browser", + "//components/autofill/core/browser:regexes", + "//components/autofill/core/common", + "//components/os_crypt", + "//components/resources", + "//components/strings", + "//content/public/browser", + "//content/public/common", + "//google_apis", + "//ipc", + "//skia", + "//sql", + "//third_party/icu", + "//third_party/libphonenumber", + "//ui/base", + "//ui/gfx", + "//ui/gfx/geometry", + "//url", + #"../third_party/libjingle/libjingle.gyp:libjingle", TODO(GYP) + #"user_prefs", TODO(GYP) + #"webdata_common", TODO(GYP) + ] +} + +proto_library("risk_proto") { + sources = [ + "risk/proto/fingerprint.proto", + ] + proto_in_dir = "risk/proto" + proto_out_dir = "components/autofill/content/browser/risk/proto" +} + +static_library("test_support") { + sources = [ + "wallet/mock_wallet_client.cc", + "wallet/mock_wallet_client.h", + "wallet/wallet_test_util.cc", + "wallet/wallet_test_util.h", + ] + + deps = [ + "//testing/gmock", + ] +} diff --git a/components/autofill/content/common/BUILD.gn b/components/autofill/content/common/BUILD.gn new file mode 100644 index 0000000..733dfa7 --- /dev/null +++ b/components/autofill/content/common/BUILD.gn @@ -0,0 +1,23 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# GYP version: components:autofill.gypi:autofill_content_common +static_library("common") { + sources = [ + "autofill_message_generator.cc", + "autofill_message_generator.h", + "autofill_messages.h", + "autofill_param_traits_macros.h", + ] + + deps = [ + "//base", + "//components/autofill/core/common", + "//content/public/common", + "//ipc", + "//third_party/WebKit/public:blink_minimal", + "//ui/gfx", + "//ui/gfx/ipc", + ] +} diff --git a/components/autofill/content/renderer/BUILD.gn b/components/autofill/content/renderer/BUILD.gn new file mode 100644 index 0000000..29ec170 --- /dev/null +++ b/components/autofill/content/renderer/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("renderer") { + sources = [ + "autofill_agent.cc", + "autofill_agent.h", + "form_autofill_util.cc", + "form_autofill_util.h", + "form_cache.cc", + "form_cache.h", + "page_click_listener.h", + "page_click_tracker.cc", + "page_click_tracker.h", + "password_autofill_agent.cc", + "password_autofill_agent.h", + "password_form_conversion_utils.cc", + "password_form_conversion_utils.h", + "password_generation_agent.cc", + "password_generation_agent.h", + "renderer_save_password_progress_logger.cc", + "renderer_save_password_progress_logger.h", + ] + + deps = [ + "//base", + "//components/autofill/content/common", + "//components/autofill/core/common", + "//components/strings", + "//content/public/common", + "//content/public/renderer", + "//ipc", + "//skia", + "//third_party/WebKit/public:blink", + ] + + if (is_win) { + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + cflags = [ "/wd4267" ] + } +} diff --git a/components/autofill/core/browser/BUILD.gn b/components/autofill/core/browser/BUILD.gn new file mode 100644 index 0000000..c479470 --- /dev/null +++ b/components/autofill/core/browser/BUILD.gn @@ -0,0 +1,202 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +if (is_android) { + import("//build/config/android/config.gni") + autofill_enable_sync = !is_android_webview_build +} else { + autofill_enable_sync = true +} + +config("autofill_browser_config") { + if (autofill_enable_sync) { + defines = [ "AUTOFILL_ENABLE_SYNC" ] + } +} + +# GYP version: components/autofill.gyp:autofill_regexes +action("regexes") { + visibility = "//components/autofill/*" + script = "//build/escape_unicode.py" + + source_prereqs = [ + "autofill_regex_constants.cc.utf8", + ] + outputs = [ + "$target_gen_dir/autofill_regex_constants.cc", + ] + + args = [ "-o", rebase_path(target_gen_dir, root_build_dir) ] + args += rebase_path(source_prereqs, root_build_dir) +} + +# GYP version: components/autofill.gyp:autofill_core_browser +static_library("browser") { + sources = [ + "address.cc", + "address.h", + "address_field.cc", + "address_field.h", + "address_i18n.cc", + "address_i18n.h", + "autocomplete_history_manager.cc", + "autocomplete_history_manager.h", + "autofill-inl.h", + "autofill_country.cc", + "autofill_country.h", + "autofill_data_model.cc", + "autofill_data_model.h", + "autofill_download.cc", + "autofill_download.h", + "autofill_driver.h", + "autofill_external_delegate.cc", + "autofill_external_delegate.h", + "autofill_field.cc", + "autofill_field.h", + "autofill_ie_toolbar_import_win.cc", + "autofill_ie_toolbar_import_win.h", + "autofill_manager.cc", + "autofill_manager.h", + "autofill_client.h", + "autofill_manager_test_delegate.h", + "autofill_metrics.cc", + "autofill_metrics.h", + "autofill_popup_delegate.h", + "autofill_profile.cc", + "autofill_profile.h", + "autofill_regex_constants.cc.utf8", + "autofill_regex_constants.h", + "autofill_regexes.cc", + "autofill_regexes.h", + "autofill_scanner.cc", + "autofill_scanner.h", + "autofill_server_field_info.h", + "autofill_type.cc", + "autofill_type.h", + "autofill_xml_parser.cc", + "autofill_xml_parser.h", + "contact_info.cc", + "contact_info.h", + "credit_card.cc", + "credit_card.h", + "credit_card_field.cc", + "credit_card_field.h", + "email_field.cc", + "email_field.h", + "field_types.h", + "form_field.cc", + "form_field.h", + "form_group.cc", + "form_group.h", + "form_structure.cc", + "form_structure.h", + "name_field.cc", + "name_field.h", + "password_generator.cc", + "password_generator.h", + "personal_data_manager.cc", + "personal_data_manager.h", + "personal_data_manager_mac.mm", + "personal_data_manager_observer.h", + "phone_field.cc", + "phone_field.h", + "phone_number.cc", + "phone_number.h", + "phone_number_i18n.cc", + "phone_number_i18n.h", + "popup_item_ids.h", + "state_names.cc", + "state_names.h", + "validation.cc", + "validation.h", + "webdata/autofill_change.cc", + "webdata/autofill_change.h", + "webdata/autofill_entry.cc", + "webdata/autofill_entry.h", + "webdata/autofill_profile_syncable_service.cc", + "webdata/autofill_profile_syncable_service.h", + "webdata/autofill_table.cc", + "webdata/autofill_table.h", + "webdata/autofill_webdata.h", + "webdata/autofill_webdata_backend.h", + "webdata/autofill_webdata_backend_impl.cc", + "webdata/autofill_webdata_backend_impl.h", + "webdata/autofill_webdata_service.cc", + "webdata/autofill_webdata_service.h", + "webdata/autofill_webdata_service_observer.h", + ] + + # Compile the generated regex file. + sources += get_target_outputs(":regexes") + + deps = [ + ":regexes", + "//base", + "//base:i18n", + "//base:prefs", + "//components/autofill/core/common", + "//components/keyed_service/core", + "//components/os_crypt", + "//components/resources", + "//components/strings", + "//google_apis", + "//skia", + "//sql", + "//third_party/icu", + "//third_party/libaddressinput", + "//third_party/libphonenumber", + "//ui/base", + "//ui/gfx", + "//ui/gfx/geometry", + "//url", + #'../third_party/fips181/fips181.gyp:fips181', TODO(GYP) + # TODO(GYP) also remove libjingle_stub_config below when this is added: + #'../third_party/libjingle/libjingle.gyp:libjingle', TODO(GYP) + #'pref_registry', TODO(GYP) + #'webdata_common', TODO(GYP) + ] + + configs += [ "//content:libjingle_stub_config" ] + direct_dependent_configs = [ ":autofill_browser_config" ] + + if (autofill_enable_sync) { + deps += [ "//sync" ] + } else { + sources -= [ + "webdata/autofill_profile_syncable_service.cc", + "webdata/autofill_profile_syncable_service.h", + ] + } + + if (is_win) { + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + cflags = [ "/wd4267" ] + } +} + +static_library("test_support") { + sources = [ + "android/test_auxiliary_profile_loader_android.cc", + "android/test_auxiliary_profile_loader_android.h", + "autofill_test_utils.cc", + "autofill_test_utils.h", + "data_driven_test.cc", + "data_driven_test.h", + "test_autofill_client.cc", + "test_autofill_client.h", + "test_autofill_driver.cc", + "test_autofill_driver.h", + "test_autofill_external_delegate.cc", + "test_autofill_external_delegate.h", + "test_personal_data_manager.cc", + "test_personal_data_manager.h", + ] + + deps = [ + "//components/autofill/core/browser", + "//components/autofill/core/common", + "//skia", + "//testing/gtest", + ] +} diff --git a/components/autofill/core/common/BUILD.gn b/components/autofill/core/common/BUILD.gn new file mode 100644 index 0000000..d75af87 --- /dev/null +++ b/components/autofill/core/common/BUILD.gn @@ -0,0 +1,55 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("common") { + sources = [ + # TODO(brettw) why are these "browser" files in the "common" target? + "../browser/android/auxiliary_profile_loader_android.cc", + "../browser/android/auxiliary_profile_loader_android.h", + "../browser/android/auxiliary_profiles_android.cc", + "../browser/android/auxiliary_profiles_android.h", + "../browser/android/component_jni_registrar.cc", + "../browser/android/component_jni_registrar.h", + "../browser/android/personal_data_manager_android.cc", + "autofill_constants.cc", + "autofill_constants.h", + "autofill_data_validation.cc", + "autofill_data_validation.h", + "autofill_pref_names.cc", + "autofill_pref_names.h", + "autofill_switches.cc", + "autofill_switches.h", + "form_data.cc", + "form_data.h", + "form_data_predictions.cc", + "form_data_predictions.h", + "form_field_data.cc", + "form_field_data.h", + "form_field_data_predictions.cc", + "form_field_data_predictions.h", + "password_autofill_util.cc", + "password_autofill_util.h", + "password_form.cc", + "password_form.h", + "password_form_fill_data.cc", + "password_form_fill_data.h", + "password_generation_util.cc", + "password_generation_util.h", + "save_password_progress_logger.cc", + "save_password_progress_logger.h", + "web_element_descriptor.cc", + "web_element_descriptor.h", + ] + + deps = [ + "//base", + "//ui/base", + "//ui/gfx", + "//url", + ] + + if (is_android) { + # deps += [ 'autofill_jni_headers' ] TODO(GYP) + } +} diff --git a/components/metrics.gypi b/components/metrics.gypi index a8f9d0c..f3dc749 100644 --- a/components/metrics.gypi +++ b/components/metrics.gypi @@ -5,6 +5,7 @@ { 'targets': [ { + # GN version: //components/metrics 'target_name': 'metrics', 'type': 'static_library', 'include_dirs': [ @@ -63,6 +64,7 @@ ], }, { + # GN version: //components/metrics:net 'target_name': 'metrics_net', 'type': 'static_library', 'include_dirs': [ @@ -80,7 +82,7 @@ { # Protobuf compiler / generator for UMA (User Metrics Analysis). # - # GN version: //component/metrics/proto:proto + # GN version: //components/metrics/proto:proto 'target_name': 'component_metrics_proto', 'type': 'static_library', 'sources': [ @@ -103,6 +105,7 @@ { # TODO(isherman): Remove all //chrome dependencies on this target, and # merge the files in this target with components_unittests. + # GN version: //components/metrics:test_support 'target_name': 'metrics_test_support', 'type': 'static_library', 'include_dirs': [ diff --git a/components/metrics/BUILD.gn b/components/metrics/BUILD.gn index 72fc0fe..689c0e8 100644 --- a/components/metrics/BUILD.gn +++ b/components/metrics/BUILD.gn @@ -2,13 +2,79 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +# GYP version: components/metrics.gypi:metrics source_set("metrics") { sources = [ + "compression_utils.cc", + "compression_utils.h", + "cloned_install_detector.cc", + "cloned_install_detector.h", + "machine_id_provider.h", + "machine_id_provider_stub.cc", + "machine_id_provider_win.cc", "metrics_hashes.cc", "metrics_hashes.h", + "metrics_log.cc", + "metrics_log.h", + "metrics_log_uploader.cc", + "metrics_log_uploader.h", + "metrics_log_manager.cc", + "metrics_log_manager.h", + "metrics_pref_names.cc", + "metrics_pref_names.h", + "metrics_provider.h", + "metrics_reporting_scheduler.cc", + "metrics_reporting_scheduler.h", + "metrics_service.cc", + "metrics_service.h", + "metrics_service_client.h", + "metrics_service_observer.cc", + "metrics_service_observer.h", + "metrics_state_manager.cc", + "metrics_state_manager.h", + "metrics_switches.cc", + "metrics_switches.h", + "persisted_logs.cc", + "persisted_logs.h", ] deps = [ "//base", + "//components/metrics/proto", + "//components/variations", + "//third_party/zlib", ] + + forward_dependent_configs_from = [ "//components/metrics/proto" ] +} + +# GYP version: components/metrics.gypi:metrics_net +static_library("net") { + sources = [ + "net/net_metrics_log_uploader.cc", + "net/net_metrics_log_uploader.h", + ] + + deps = [ + ":metrics", + "//net", + ] + + forward_dependent_configs_from = [ ":metrics" ] } + +# GYP version: components/metrics.gypi:metrics_test_support +static_library("test_support") { + sources = [ + "test_metrics_service_client.cc", + "test_metrics_service_client.h", + ] + + deps = [ + ":metrics", + ] + + forward_dependent_configs_from = [ ":metrics" ] +} + +# TODO(GYP): metrics_chromeos diff --git a/components/policy.gypi b/components/policy.gypi index b5dc32c..24d671f8 100644 --- a/components/policy.gypi +++ b/components/policy.gypi @@ -34,6 +34,7 @@ ['component=="static_library"', { 'targets': [ { + # GN version: //components/policy:policy_component 'target_name': 'policy_component', 'type': 'none', 'dependencies': [ @@ -42,6 +43,7 @@ ], }, { + # GN version: //components/policy:policy_component_common 'target_name': 'policy_component_common', 'type': 'static_library', 'includes': [ @@ -49,6 +51,7 @@ ], }, { + # GN version: //components/policy:policy_component_browser 'target_name': 'policy_component_browser', 'type': 'static_library', 'dependencies': [ @@ -62,6 +65,7 @@ }, { # component=="static_library" 'targets': [ { + # GN version: //components/policy:policy_component 'target_name': 'policy_component', 'type': 'shared_library', 'includes': [ @@ -70,6 +74,7 @@ ], }, { + # GN version: //components/policy:policy_component_common 'target_name': 'policy_component_common', 'type': 'none', 'dependencies': [ @@ -77,6 +82,7 @@ ], }, { + # GN version: //components/policy:policy_component_browser 'target_name': 'policy_component_browser', 'type': 'none', 'dependencies': [ @@ -88,6 +94,7 @@ ['configuration_policy==1', { 'targets': [ { + # GN version: //components/policy:cloud_policy_code_generate 'target_name': 'cloud_policy_code_generate', 'type': 'none', 'actions': [ @@ -127,6 +134,7 @@ }, }, { + # GN version: //components/policy:cloud_policy_proto_generated_compile 'target_name': 'cloud_policy_proto_generated_compile', 'type': '<(component)', 'sources': [ @@ -152,6 +160,7 @@ }, { # This target builds the "full" protobuf, used for tests only. + # GN version: //components/policy:chrome_settings_proto_generated_compile 'target_name': 'chrome_settings_proto_generated_compile', 'type': 'static_library', 'sources': [ @@ -170,6 +179,7 @@ ], }, { + # GN version: //components/policy 'target_name': 'policy', 'type': 'static_library', 'hard_dependency': 1, @@ -233,6 +243,7 @@ ], }, { + # GN version: //components/policy:test_support 'target_name': 'policy_test_support', 'type': 'none', 'hard_dependency': 1, @@ -248,6 +259,7 @@ ], }, { + # GN version: //components/policy:policy_component_test_support 'target_name': 'policy_component_test_support', 'type': 'static_library', # This must be undefined so that POLICY_EXPORT works correctly in diff --git a/components/policy/BUILD.gn b/components/policy/BUILD.gn new file mode 100644 index 0000000..200c584 --- /dev/null +++ b/components/policy/BUILD.gn @@ -0,0 +1,187 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//third_party/protobuf/proto_library.gni") +import("//tools/grit/grit_rule.gni") + +if (is_component_build) { + component("policy_component") { + deps = [ + "//components/policy/core/browser", + "//components/policy/core/common", + ] + } + group("policy_component_browser") { + deps = [ ":policy_component" ] + } + group("policy_component_common") { + deps = [ ":policy_component" ] + } +} else { # Compile to separate libraries. + group("policy_component") { + deps = [ + ":policy_component_browser", + ":policy_component_common", + ] + } + component("policy_component_browser") { + deps = [ "//components/policy/core/browser" ] + } + component("policy_component_common") { + deps = [ "//components/policy/core/common" ] + } +} + +if (enable_configuration_policy) { + # TODO(brettw) this component should use target_gen_dir instead but the GYP + # build puts everything into the following directory. We do the same for now. + policy_gen_dir = "$root_gen_dir/policy" + + # This protobuf is equivalent to chrome_settings.proto but shares messages + # for policies of the same type, so that less classes have to be generated + # and compiled. + cloud_policy_proto_path = "$policy_gen_dir/cloud_policy.proto" + + # This is the "full" protobuf, which defines one protobuf message per + # policy. It is also the format currently used by the server. + chrome_settings_proto_path = "$policy_gen_dir/chrome_settings.proto" + + constants_header_path = "$policy_gen_dir/policy_constants.h" + constants_source_path = "$policy_gen_dir/policy_constants.cc" + protobuf_decoder_path = "$policy_gen_dir/cloud_policy_generated.cc" + + action("cloud_policy_code_generate") { + script = "tools/generate_policy_source.py" + + if (is_chromeos) { + chromeos_flag = "1" + } else { + chromeos_flag = "0" + } + + source_prereqs = [ + "resources/policy_templates.json", + ] + outputs = [ + constants_header_path, + constants_source_path, + protobuf_decoder_path, + chrome_settings_proto_path, + cloud_policy_proto_path, + ] + + args = [ + "--policy-constants-header=" + + rebase_path(constants_header_path, root_build_dir), + "--policy-constants-source=" + + rebase_path(constants_source_path, root_build_dir), + "--chrome-settings-protobuf=" + + rebase_path(chrome_settings_proto_path, root_build_dir), + "--cloud-policy-protobuf=" + + rebase_path(cloud_policy_proto_path, root_build_dir), + "--cloud-policy-decoder=" + + rebase_path(protobuf_decoder_path, root_build_dir), + os, + chromeos_flag, + rebase_path("resources/policy_templates.json", root_build_dir), + ] + } + + proto_library("cloud_policy_proto_generated_compile") { + sources = [ cloud_policy_proto_path ] + + proto_in_dir = policy_gen_dir + proto_out_dir = "policy/proto" + cc_generator_options = "dllexport_decl=POLICY_PROTO_EXPORT:" + cc_include = "components/policy/policy_proto_export.h" + defines = [ "POLICY_PROTO_COMPILATION" ] + + deps = [ + ":cloud_policy_code_generate", + ] + } + + # This target builds the "full" protobuf, used for tests only. + proto_library("chrome_settings_proto_generated_compile") { + sources = [ chrome_settings_proto_path ] + proto_in_dir = policy_gen_dir + proto_out_dir = "policy/proto" + + deps = [ + ":cloud_policy_code_generate", + ":cloud_policy_proto_generated_compile", + ] + } + + static_library("policy") { + sources = [ + constants_header_path, + constants_source_path, + protobuf_decoder_path, + ] + + defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ] + + deps = [ + ":cloud_policy_code_generate", + ":cloud_policy_proto_generated_compile", + "//base", + "//third_party/protobuf:protobuf_lite", + ] + } + + group("test_support") { + deps = [ + ":chrome_settings_proto_generated_compile", + ":policy", + ] + } + + static_library("policy_component_test_support") { + sources = [ + "core/browser/configuration_policy_pref_store_test.cc", + "core/browser/configuration_policy_pref_store_test.h", + "core/common/cloud/mock_cloud_external_data_manager.cc", + "core/common/cloud/mock_cloud_external_data_manager.h", + "core/common/cloud/mock_cloud_policy_client.cc", + "core/common/cloud/mock_cloud_policy_client.h", + "core/common/cloud/mock_cloud_policy_store.cc", + "core/common/cloud/mock_cloud_policy_store.h", + "core/common/cloud/mock_device_management_service.cc", + "core/common/cloud/mock_device_management_service.h", + "core/common/cloud/mock_user_cloud_policy_store.cc", + "core/common/cloud/mock_user_cloud_policy_store.h", + "core/common/cloud/policy_builder.cc", + "core/common/cloud/policy_builder.h", + "core/common/configuration_policy_provider_test.cc", + "core/common/configuration_policy_provider_test.h", + "core/common/mock_configuration_policy_provider.cc", + "core/common/mock_configuration_policy_provider.h", + "core/common/mock_policy_service.cc", + "core/common/mock_policy_service.h", + "core/common/policy_test_utils.cc", + "core/common/policy_test_utils.h", + "core/common/preferences_mock_mac.cc", + "core/common/preferences_mock_mac.h", + ] + + if (is_chromeos) { + sources -= [ + "core/common/cloud/mock_user_cloud_policy_store.cc", + "core/common/cloud/mock_user_cloud_policy_store.h", + ] + } + + deps = [ + ":policy_component", + ":test_support", + "//components/policy/proto", + "//testing/gmock", + "//testing/gtest", + ] + } +} + +#TODO(GYP) policy templates, chrome_manifest_bundle diff --git a/components/policy/core/browser/BUILD.gn b/components/policy/core/browser/BUILD.gn new file mode 100644 index 0000000..9e19d6e --- /dev/null +++ b/components/policy/core/browser/BUILD.gn @@ -0,0 +1,64 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +# GYP version: components/policy.gypi:policy_component_core_browser +source_set("browser") { + sources = [ + # Note that these sources are always included, even for builds that disable + # policy. Most source files should go in the conditional sources list + # below. url_blacklist_manager.h is used by managed mode. + "url_blacklist_manager.cc", + "url_blacklist_manager.h", + ] + + defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ] + + deps = [ + "//base", + "//base:prefs", + "//base/third_party/dynamic_annotations", + "//components/keyed_service/core", + "//components/pref_registry", + "//components/strings", + "//components/url_matcher", + "//net", + "//ui/base", + #'bookmarks_browser', TODO(GYP) + ] + + if (enable_configuration_policy) { + sources += [ + "autofill_policy_handler.cc", + "autofill_policy_handler.h", + "browser_policy_connector.cc", + "browser_policy_connector.h", + "browser_policy_connector_ios.h", + "browser_policy_connector_ios.mm", + "cloud/message_util.cc", + "cloud/message_util.h", + "configuration_policy_handler.cc", + "configuration_policy_handler.h", + "configuration_policy_handler_list.cc", + "configuration_policy_handler_list.h", + "configuration_policy_pref_store.cc", + "configuration_policy_pref_store.h", + "managed_bookmarks_tracker.cc", + "managed_bookmarks_tracker.h", + "policy_error_map.cc", + "policy_error_map.h", + "url_blacklist_policy_handler.cc", + "url_blacklist_policy_handler.h", + ] + + deps += [ + "//components/autofill/core/browser", + "//components/autofill/core/common", + "//components/policy", + "//components/policy/proto", + "//third_party/icu", + ] + } +} diff --git a/components/policy/core/common/BUILD.gn b/components/policy/core/common/BUILD.gn new file mode 100644 index 0000000..991927b --- /dev/null +++ b/components/policy/core/common/BUILD.gn @@ -0,0 +1,201 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +source_set("common") { + defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ] + + if (enable_configuration_policy) { + sources = [ + "cloud/cloud_external_data_manager.cc", + "cloud/cloud_external_data_manager.h", + "cloud/cloud_policy_client.cc", + "cloud/cloud_policy_client.h", + "cloud/cloud_policy_client_registration_helper.cc", + "cloud/cloud_policy_client_registration_helper.h", + "cloud/cloud_policy_constants.cc", + "cloud/cloud_policy_constants.h", + "cloud/cloud_policy_core.cc", + "cloud/cloud_policy_core.h", + "cloud/cloud_policy_manager.cc", + "cloud/cloud_policy_manager.h", + "cloud/cloud_policy_refresh_scheduler.cc", + "cloud/cloud_policy_refresh_scheduler.h", + "cloud/cloud_policy_service.cc", + "cloud/cloud_policy_service.h", + "cloud/cloud_policy_store.cc", + "cloud/cloud_policy_store.h", + "cloud/cloud_policy_validator.cc", + "cloud/cloud_policy_validator.h", + "cloud/component_cloud_policy_service.cc", + "cloud/component_cloud_policy_service.h", + "cloud/component_cloud_policy_store.cc", + "cloud/component_cloud_policy_store.h", + "cloud/component_cloud_policy_updater.cc", + "cloud/component_cloud_policy_updater.h", + "cloud/device_management_service.cc", + "cloud/device_management_service.h", + "cloud/enterprise_metrics.cc", + "cloud/enterprise_metrics.h", + "cloud/external_policy_data_fetcher.cc", + "cloud/external_policy_data_fetcher.h", + "cloud/external_policy_data_updater.cc", + "cloud/external_policy_data_updater.h", + "cloud/policy_header_io_helper.cc", + "cloud/policy_header_io_helper.h", + "cloud/policy_header_service.cc", + "cloud/policy_header_service.h", + "cloud/rate_limiter.cc", + "cloud/rate_limiter.h", + "cloud/resource_cache.cc", + "cloud/resource_cache.h", + "cloud/system_policy_request_context.cc", + "cloud/system_policy_request_context.h", + "cloud/user_cloud_policy_manager.cc", + "cloud/user_cloud_policy_manager.h", + "cloud/user_cloud_policy_store.cc", + "cloud/user_cloud_policy_store.h", + "cloud/user_cloud_policy_store_base.cc", + "cloud/user_cloud_policy_store_base.h", + "cloud/user_info_fetcher.cc", + "cloud/user_info_fetcher.h", + "cloud/user_policy_request_context.cc", + "cloud/user_policy_request_context.h", + "async_policy_loader.cc", + "async_policy_loader.h", + "async_policy_provider.cc", + "async_policy_provider.h", + "config_dir_policy_loader.cc", + "config_dir_policy_loader.h", + "configuration_policy_provider.cc", + "configuration_policy_provider.h", + "external_data_fetcher.cc", + "external_data_fetcher.h", + "external_data_manager.h", + "forwarding_policy_provider.cc", + "forwarding_policy_provider.h", + "mac_util.cc", + "mac_util.h", + "policy_bundle.cc", + "policy_bundle.h", + "policy_details.h", + "policy_loader_ios.h", + "policy_loader_ios.mm", + "policy_loader_mac.cc", + "policy_loader_mac.h", + "policy_loader_win.cc", + "policy_loader_win.h", + "policy_load_status.cc", + "policy_load_status.h", + "policy_map.cc", + "policy_map.h", + "policy_namespace.cc", + "policy_namespace.h", + "policy_pref_names.cc", + "policy_pref_names.h", + "policy_provider_android.cc", + "policy_provider_android.h", + "policy_provider_android_delegate.h", + "policy_service.cc", + "policy_service.h", + "policy_service_impl.cc", + "policy_service_impl.h", + "policy_statistics_collector.cc", + "policy_statistics_collector.h", + "policy_switches.cc", + "policy_switches.h", + "policy_types.h", + "preferences_mac.cc", + "preferences_mac.h", + "preg_parser_win.cc", + "preg_parser_win.h", + "registry_dict_win.cc", + "registry_dict_win.h", + "schema.cc", + "schema.h", + "schema_internal.h", + "schema_map.cc", + "schema_map.h", + "schema_registry.cc", + "schema_registry.h", + "../../policy_export.h", + ] + + deps = [ + "//base:prefs", + "//base/third_party/dynamic_annotations", + "//components/json_schema", + "//components/policy", + "//components/policy/proto", + "//google_apis", + "//net", + "//third_party/re2", + "//url", + ] + + if (is_android) { + sources += [ "cloud/component_cloud_policy_service_stub.cc" ] + sources -= [ + "cloud/component_cloud_policy_service.cc", + "cloud/component_cloud_policy_store.cc", + "cloud/component_cloud_policy_store.h", + "cloud/component_cloud_policy_updater.cc", + "cloud/component_cloud_policy_updater.h", + "cloud/external_policy_data_fetcher.cc", + "cloud/external_policy_data_fetcher.h", + "cloud/external_policy_data_updater.cc", + "cloud/external_policy_data_updater.h", + "cloud/resource_cache.cc", + "cloud/resource_cache.h", + "config_dir_policy_loader.cc", + "config_dir_policy_loader.h", + "policy_load_status.cc", + "policy_load_status.h", + ] + } + if (is_chromeos) { + sources += [ + "proxy_policy_provider.cc", + "proxy_policy_provider.h", + ] + sources -= [ + "cloud/cloud_policy_client_registration_helper.cc", + "cloud/cloud_policy_client_registration_helper.h", + "cloud/user_cloud_policy_manager.cc", + "cloud/user_cloud_policy_manager.h", + "cloud/user_cloud_policy_store.cc", + "cloud/user_cloud_policy_store.h", + ] + } + if (!is_ios && !is_mac) { + sources -= [ + "mac_util.cc", + "mac_util.h", + ] + } + } else { + # Some of the policy code is always enabled, so that other parts of Chrome + # can always interface with the PolicyService without having to #ifdef on + # ENABLE_CONFIGURATION_POLICY. + sources = [ + "external_data_fetcher.h", + "external_data_fetcher.cc", + "external_data_manager.h", + "policy_map.cc", + "policy_map.h", + "policy_namespace.cc", + "policy_namespace.h", + "policy_pref_names.cc", + "policy_pref_names.h", + "policy_service.cc", + "policy_service.h", + "policy_service_stub.cc", + "policy_service_stub.h", + ] + deps = [ + "//base", + ] + } +} diff --git a/components/policy/policy_browser.gypi b/components/policy/policy_browser.gypi index 9d7df97..987da77 100644 --- a/components/policy/policy_browser.gypi +++ b/components/policy/policy_browser.gypi @@ -31,6 +31,7 @@ 'core/browser/url_blacklist_manager.h', ], 'conditions': [ + # GN version: //components/policy/core/browser ['configuration_policy==1', { 'dependencies': [ 'autofill_core_browser', diff --git a/components/policy/policy_common.gypi b/components/policy/policy_common.gypi index 1d7996a..6afa3d8 100644 --- a/components/policy/policy_common.gypi +++ b/components/policy/policy_common.gypi @@ -3,6 +3,7 @@ # found in the LICENSE file. { + # GN version: //components/policy/core/common 'dependencies': [ '../base/base.gyp:base', ], diff --git a/components/policy/proto/BUILD.gn b/components/policy/proto/BUILD.gn index 13b7e2f..cc84042 100644 --- a/components/policy/proto/BUILD.gn +++ b/components/policy/proto/BUILD.gn @@ -16,6 +16,7 @@ proto_library("proto") { sources += [ "device_management_local.proto" ] } + proto_out_dir = "policy/proto" cc_generator_options = "dllexport_decl=POLICY_PROTO_EXPORT:" cc_include = "components/policy/policy_proto_export.h" defines = [ "POLICY_PROTO_COMPILATION" ] diff --git a/components/variations.gypi b/components/variations.gypi index e560130..db46140 100644 --- a/components/variations.gypi +++ b/components/variations.gypi @@ -5,6 +5,7 @@ { 'targets': [ { + # GN version: //components/variations 'target_name': 'variations', 'type': 'static_library', 'include_dirs': [ diff --git a/components/variations/BUILD.gn b/components/variations/BUILD.gn new file mode 100644 index 0000000..827155cf6 --- /dev/null +++ b/components/variations/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("variations") { + sources = [ + "active_field_trials.cc", + "active_field_trials.h", + "caching_permuted_entropy_provider.cc", + "caching_permuted_entropy_provider.h", + "entropy_provider.cc", + "entropy_provider.h", + "metrics_util.cc", + "metrics_util.h", + "pref_names.cc", + "pref_names.h", + "processed_study.cc", + "processed_study.h", + "study_filtering.cc", + "study_filtering.h", + "variations_associated_data.cc", + "variations_associated_data.h", + "variations_seed_processor.cc", + "variations_seed_processor.h", + "variations_seed_simulator.cc", + "variations_seed_simulator.h", + ] + + deps = [ + "//base", + "//components/variations/proto", + "//third_party/mt19937ar", + ] +} diff --git a/components/variations/proto/BUILD.gn b/components/variations/proto/BUILD.gn new file mode 100644 index 0000000..5895d57 --- /dev/null +++ b/components/variations/proto/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +proto_library("proto") { + sources = [ + "permuted_entropy_cache.proto", + "study.proto", + "variations_seed.proto", + ] +} diff --git a/extensions/common/api/BUILD.gn b/extensions/common/api/BUILD.gn index b4321de6..5a8c7db 100644 --- a/extensions/common/api/BUILD.gn +++ b/extensions/common/api/BUILD.gn @@ -18,5 +18,6 @@ generated_extensions_api("extensions_api") { ] root_namespace = "extensions::core_api" impl_dir = "//extensions/browser/api" + bundle = true deps = [ "//skia" ] } diff --git a/extensions/generated_extensions_api.gni b/extensions/generated_extensions_api.gni index c8817a6..e231157 100644 --- a/extensions/generated_extensions_api.gni +++ b/extensions/generated_extensions_api.gni @@ -11,20 +11,27 @@ # # sources [required] A list of schema files to be compiled. # -# root_namespace [required] The namespace in which generated API code is to be +# root_namespace [required] +# The namespace in which generated API code is to be # wrapped. C++ namespace syntax is accepted for nested namespace # (e.g. "foo::bar::api"). # -# impl_dir [required] The path containing C++ implementations of API functions. -# This path is used as the root path when looking for -# {schema}/{schema}_api.h headers during the API bundle generation phase. -# Such headers, if found, are automatically included by the generated code. +# bundle [optional, default = false] +# Boolean indicating if the schema files should be bundled or not. # -# uncompiled_sources [optional] A list of schema files which should not be -# compiled, but which should still be processed for API bundle generation. +# impl_dir [required if bundle = true, otherwise unused] +# The path containing C++ implementations of API functions. This path is +# used as the root path when looking for {schema}/{schema}_api.h headers +# during the API bundle generation phase. Such headers, if found, are +# automatically included by the generated code. # -# deps [optional] If any deps are specified they will be inherited by the -# static library target. +# uncompiled_sources [optional, only used when bundle = true] +# A list of schema files which should not be compiled, but which should still +# be processed for API bundle generation. +# +# deps [optional] +# If any deps are specified they will be inherited by the static library +# target. # # The static libarary target also inherits the visibility and output_name # of its invoker. @@ -34,8 +41,8 @@ template("generated_extensions_api") { "\"sources\" must be defined for the $target_name template.") assert(defined(invoker.root_namespace), "\"root_namespace\" must be defined for the $target_name template.") - assert(defined(invoker.impl_dir), - "\"impl_dir\" must be defined for the $target_name template.") + + bundle = defined(invoker.bundle) && invoker.bundle # Keep a copy of the target_name here since it will be trampled # in nested targets. @@ -49,11 +56,6 @@ template("generated_extensions_api") { schemas = invoker.sources root_namespace = invoker.root_namespace - impl_dir = invoker.impl_dir - uncompiled_schemas = [] - if (defined(invoker.uncompiled_sources)) { - uncompiled_schemas = invoker.uncompiled_sources - } compiler_root = "//tools/json_schema_compiler" compiler_script = "$compiler_root/compiler.py" @@ -88,38 +90,51 @@ template("generated_extensions_api") { visibility = target_visibility } - bundle_generator_name = target_name + "_bundle_generator" - action(bundle_generator_name) { - script = compiler_script - source_prereqs = compiler_sources + schemas + uncompiled_schemas - outputs = [ - "$target_gen_dir/generated_api.cc", - "$target_gen_dir/generated_api.h", - "$target_gen_dir/generated_schemas.cc", - "$target_gen_dir/generated_schemas.h", - ] - args = [ - "--root=" + rebase_path("//", root_build_dir), - "--destdir=" + rebase_path(root_gen_dir, root_build_dir), - "--namespace=$root_namespace", - "--generator=cpp-bundle", - "--impl-dir=" + rebase_path(impl_dir, "//"), - ] + - rebase_path(schemas, root_build_dir) + - rebase_path(uncompiled_schemas, root_build_dir) + if (bundle) { + assert(defined(invoker.impl_dir), + "\"impl_dir\" must be defined for the $target_name template.") + impl_dir = invoker.impl_dir + + uncompiled_schemas = [] + if (defined(invoker.uncompiled_sources)) { + uncompiled_schemas = invoker.uncompiled_sources + } + + bundle_generator_name = target_name + "_bundle_generator" + action(bundle_generator_name) { + script = compiler_script + source_prereqs = compiler_sources + schemas + uncompiled_schemas + outputs = [ + "$target_gen_dir/generated_api.cc", + "$target_gen_dir/generated_api.h", + "$target_gen_dir/generated_schemas.cc", + "$target_gen_dir/generated_schemas.h", + ] + args = [ + "--root=" + rebase_path("//", root_build_dir), + "--destdir=" + rebase_path(root_gen_dir, root_build_dir), + "--namespace=$root_namespace", + "--generator=cpp-bundle", + "--impl-dir=" + rebase_path(impl_dir, "//"), + ] + + rebase_path(schemas, root_build_dir) + + rebase_path(uncompiled_schemas, root_build_dir) + } } source_set(target_name) { - sources = - get_target_outputs(":$schema_generator_name") + - get_target_outputs(":$bundle_generator_name") + sources = get_target_outputs(":$schema_generator_name") deps = [ ":$schema_generator_name", - ":$bundle_generator_name", "//tools/json_schema_compiler:generated_api_util", ] + if (bundle) { + sources += get_target_outputs(":$bundle_generator_name") + deps += [ ":$bundle_generator_name" ] + } + if (defined(invoker.deps)) { deps += invoker.deps } diff --git a/net/BUILD.gn b/net/BUILD.gn index db3e631..2ee68d3 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn @@ -752,6 +752,8 @@ if (use_v8_in_net) { "//url", "//v8", ] + + forward_dependent_configs_from = [ ":net" ] } } diff --git a/third_party/libphonenumber/BUILD.gn b/third_party/libphonenumber/BUILD.gn new file mode 100644 index 0000000..c4d244b --- /dev/null +++ b/third_party/libphonenumber/BUILD.gn @@ -0,0 +1,100 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +proto_library("proto") { + sources = [ + "src/resources/phonemetadata.proto", + "src/resources/phonenumber.proto", + ] + proto_in_dir = "src/resources" + proto_out_dir = "third_party/libphonenumber/phonenumbers" +} + +config("libphonenumber_config") { + include_dirs = [ + "src", + "$root_gen_dir/protoc_out/third_party/libphonenumber", + ] + defines = [ "I18N_PHONENUMBERS_USE_ICU_REGEXP=1" ] + if (!is_android) { + defines += [ "I18N_PHONENUMBERS_NO_THREAD_SAFETY=1" ] + } +} + +# GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_without_metadata +static_library("libphonenumber_without_metadata") { + sources = [ + "src/phonenumbers/asyoutypeformatter.cc", + "src/phonenumbers/base/strings/string_piece.cc", + "src/phonenumbers/default_logger.cc", + "src/phonenumbers/logger.cc", + "src/phonenumbers/phonenumber.cc", + "src/phonenumbers/phonenumbermatch.cc", + "src/phonenumbers/phonenumbermatcher.cc", + "src/phonenumbers/phonenumberutil.cc", + "src/phonenumbers/regexp_adapter_icu.cc", + "src/phonenumbers/regexp_cache.cc", + "src/phonenumbers/string_byte_sink.cc", + "src/phonenumbers/stringutil.cc", + "src/phonenumbers/unicodestring.cc", + "src/phonenumbers/utf/rune.c", + "src/phonenumbers/utf/unicodetext.cc", + "src/phonenumbers/utf/unilib.cc", + ] + + direct_dependent_configs = [ ":libphonenumber_config" ] + + deps = [ + ":proto", + "//third_party/icu", + "//third_party/protobuf:protobuf_lite", + ] + + forward_dependent_configs_from = [ ":proto" ] +} + +# Library used by clients that includes production metadata. +# GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber +static_library("libphonenumber") { + sources = [ + # Comment next line and uncomment the line after, if complete metadata + # (with examples) is needed. + "src/phonenumbers/lite_metadata.cc", + #"src/phonenumbers/metadata.cc", + ] + + deps = [ + ":libphonenumber_without_metadata", + ] + forward_dependent_configs_from = deps +} + +# GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests +test("libphonenumber_unittests") { + sources = [ + "src/phonenumbers/test_metadata.cc", + "src/test/phonenumbers/asyoutypeformatter_test.cc", + "src/test/phonenumbers/phonenumbermatch_test.cc", + "src/test/phonenumbers/phonenumbermatcher_test.cc", + "src/test/phonenumbers/phonenumberutil_test.cc", + "src/test/phonenumbers/regexp_adapter_test.cc", + "src/test/phonenumbers/stringutil_test.cc", + "src/test/phonenumbers/test_util.cc", + "src/test/phonenumbers/unicodestring_test.cc", + ] + + include_dirs = [ "src/test" ] + + deps = [ + ":libphonenumber_without_metadata", + "//base", + "//base/test:run_all_unittests", + "//base/third_party/dynamic_annotations", + "//third_party/icu", + "//testing/gmock", + "//testing/gtest", + ] +} diff --git a/third_party/libphonenumber/libphonenumber.gyp b/third_party/libphonenumber/libphonenumber.gyp index f002790..229440b 100644 --- a/third_party/libphonenumber/libphonenumber.gyp +++ b/third_party/libphonenumber/libphonenumber.gyp @@ -35,6 +35,7 @@ 'targets': [{ # Build a library without metadata so that we can use it with both testing # and production metadata. This library should not be used by clients. + # GN version: //third_party/libphonenumber:libphonenumber_without_metadata 'target_name': 'libphonenumber_without_metadata', 'type': 'static_library', 'dependencies': [ @@ -93,6 +94,7 @@ }, { # Library used by clients that includes production metadata. + # GN version: //third_party/libphonenumber 'target_name': 'libphonenumber', 'type': 'static_library', 'dependencies': [ @@ -109,6 +111,7 @@ ], }, { + # GN version: //third_party/libphonenumber:libphonenumber_unittests 'target_name': 'libphonenumber_unittests', 'type': 'executable', 'sources': [ diff --git a/third_party/mt19937ar/BUILD.gn b/third_party/mt19937ar/BUILD.gn new file mode 100644 index 0000000..35c2d9b --- /dev/null +++ b/third_party/mt19937ar/BUILD.gn @@ -0,0 +1,10 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("mt19937ar") { + sources = [ + "mt19937ar.cc", + "mt19937ar.h", + ] +} diff --git a/third_party/protobuf/proto_library.gni b/third_party/protobuf/proto_library.gni index 62efd78..3f4cae9 100644 --- a/third_party/protobuf/proto_library.gni +++ b/third_party/protobuf/proto_library.gni @@ -30,6 +30,9 @@ # String listing an extra include that should be passed. # Example: cc_include = "foo/bar.h" # +# deps (optional) +# Additional dependencies. +# # Parameters for compiling the generated code: # # defines (optional) @@ -125,6 +128,10 @@ template("proto_library") { ] deps = [ protoc_label ] + + if (defined(invoker.deps)) { + deps += invoker.deps + } } source_set(target_name) { diff --git a/ui/accessibility/BUILD.gn b/ui/accessibility/BUILD.gn index e1c61d2..64e39c9 100644 --- a/ui/accessibility/BUILD.gn +++ b/ui/accessibility/BUILD.gn @@ -70,4 +70,5 @@ generated_extensions_api("ax_gen") { sources = [ "ax_enums.idl" ] root_namespace = "" impl_dir = "." + bundle = true } diff --git a/ui/gfx/ipc/BUILD.gn b/ui/gfx/ipc/BUILD.gn new file mode 100644 index 0000000..8f11fa8 --- /dev/null +++ b/ui/gfx/ipc/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +component("ipc") { + output_name = "gfx_ipc" + + sources = [ + "gfx_param_traits.cc", + "gfx_param_traits.h", + ] + + defines = [ "GFX_IPC_IMPLEMENTATION" ] + + deps = [ + "//base", + "//ipc", + "//skia", + "//ui/gfx", + ] +} diff --git a/ui/gfx/ipc/gfx_ipc.gyp b/ui/gfx/ipc/gfx_ipc.gyp index 1facce5..2c527f0 100644 --- a/ui/gfx/ipc/gfx_ipc.gyp +++ b/ui/gfx/ipc/gfx_ipc.gyp @@ -8,6 +8,7 @@ }, 'targets': [ { + # GN version: //ui/gfx/ipc 'target_name': 'gfx_ipc', 'type': '<(component)', 'dependencies': [ |