summaryrefslogtreecommitdiffstats
path: root/android_webview/BUILD.gn
blob: bf573d734484811adf19b13fb88f214b622a401c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# Copyright 2015 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/android/config.gni")
import("//build/config/android/rules.gni")
import("//build/config/locales.gni")
import("//tools/grit/repack.gni")
import("system_webview_apk_tmpl.gni")
import("webview_repack_locales.gni")

declare_args() {
  # Package name of the system_webview_apk target.
  system_webview_package_name = "com.android.webview"
}

if (!defined(use_webview_internal_framework)) {
  use_webview_internal_framework = false
}

group("android_webview") {
  if (!use_webview_internal_framework) {
    deps = [
      ":system_webview_apk",
    ]
  }
}

jinja_template("system_webview_manifest") {
  input = "apk/java/AndroidManifest.xml"
  output = "$target_gen_dir/system_webview_manifest/AndroidManifest.xml"
  variables = [ "package=$system_webview_package_name" ]
}

webview_repack_locales("repack_locales") {
  input_locales = locales
  output_locales = locales
}

locale_pak_resources("locale_paks") {
  sources = [
    "$root_out_dir/android_webview/locales/am.pak",
    "$root_out_dir/android_webview/locales/ar.pak",
    "$root_out_dir/android_webview/locales/bg.pak",
    "$root_out_dir/android_webview/locales/bn.pak",
    "$root_out_dir/android_webview/locales/ca.pak",
    "$root_out_dir/android_webview/locales/cs.pak",
    "$root_out_dir/android_webview/locales/da.pak",
    "$root_out_dir/android_webview/locales/de.pak",
    "$root_out_dir/android_webview/locales/el.pak",
    "$root_out_dir/android_webview/locales/en-GB.pak",
    "$root_out_dir/android_webview/locales/en-US.pak",
    "$root_out_dir/android_webview/locales/es-419.pak",
    "$root_out_dir/android_webview/locales/es.pak",
    "$root_out_dir/android_webview/locales/et.pak",
    "$root_out_dir/android_webview/locales/fa.pak",
    "$root_out_dir/android_webview/locales/fi.pak",
    "$root_out_dir/android_webview/locales/fil.pak",
    "$root_out_dir/android_webview/locales/fr.pak",
    "$root_out_dir/android_webview/locales/gu.pak",
    "$root_out_dir/android_webview/locales/he.pak",
    "$root_out_dir/android_webview/locales/hi.pak",
    "$root_out_dir/android_webview/locales/hr.pak",
    "$root_out_dir/android_webview/locales/hu.pak",
    "$root_out_dir/android_webview/locales/id.pak",
    "$root_out_dir/android_webview/locales/it.pak",
    "$root_out_dir/android_webview/locales/ja.pak",
    "$root_out_dir/android_webview/locales/kn.pak",
    "$root_out_dir/android_webview/locales/ko.pak",
    "$root_out_dir/android_webview/locales/lt.pak",
    "$root_out_dir/android_webview/locales/lv.pak",
    "$root_out_dir/android_webview/locales/ml.pak",
    "$root_out_dir/android_webview/locales/mr.pak",
    "$root_out_dir/android_webview/locales/ms.pak",
    "$root_out_dir/android_webview/locales/nb.pak",
    "$root_out_dir/android_webview/locales/nl.pak",
    "$root_out_dir/android_webview/locales/pl.pak",
    "$root_out_dir/android_webview/locales/pt-BR.pak",
    "$root_out_dir/android_webview/locales/pt-PT.pak",
    "$root_out_dir/android_webview/locales/ro.pak",
    "$root_out_dir/android_webview/locales/ru.pak",
    "$root_out_dir/android_webview/locales/sk.pak",
    "$root_out_dir/android_webview/locales/sl.pak",
    "$root_out_dir/android_webview/locales/sr.pak",
    "$root_out_dir/android_webview/locales/sv.pak",
    "$root_out_dir/android_webview/locales/sw.pak",
    "$root_out_dir/android_webview/locales/ta.pak",
    "$root_out_dir/android_webview/locales/te.pak",
    "$root_out_dir/android_webview/locales/th.pak",
    "$root_out_dir/android_webview/locales/tr.pak",
    "$root_out_dir/android_webview/locales/uk.pak",
    "$root_out_dir/android_webview/locales/vi.pak",
    "$root_out_dir/android_webview/locales/zh-CN.pak",
    "$root_out_dir/android_webview/locales/zh-TW.pak",
  ]
  deps = [
    ":repack_locales",
  ]
}

repack("repack_pack") {
  sources = [
    "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
    "$root_gen_dir/blink/public/resources/blink_resources.pak",
    "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
    "$root_gen_dir/content/content_resources.pak",
    "$root_gen_dir/net/net_resources.pak",
    "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
    "$target_gen_dir/aw_resources.pak",
  ]
  deps = [
    ":generate_aw_resources",
    "//content:resources",
    "//content/app/resources",
    "//net:net_resources",
    "//third_party/WebKit/public:image_resources",
    "//third_party/WebKit/public:resources",
    "//ui/resources",
  ]
  output = "$target_gen_dir/webviewchromium.pak"
}

webview_license_path = "$target_gen_dir/webview_licenses.notice"

android_assets("pak_file_assets") {
  sources = [
    "$target_gen_dir/webviewchromium.pak",
  ]
  deps = [
    ":repack_pack",
  ]
  disable_compression = true
}

android_assets("assets") {
  sources = [
    webview_license_path,
  ]
  deps = [
    ":generate_webview_license_notice",
    ":pak_file_assets",
    "//third_party/icu:icu_assets",
    "//v8:v8_external_startup_data_assets",
  ]
}

action("generate_webview_license_notice") {
  script = "tools/webview_licenses.py"
  inputs = exec_script("//android_webview/tools/webview_licenses.py",
                       [ "gn_notice_deps" ],
                       "value")
  inputs += [ "tools/licenses_notice.tmpl" ]
  outputs = [
    webview_license_path,
  ]
  args = [
    "notice",
    rebase_path(webview_license_path),
  ]
}

android_resources("system_webview_resources") {
  resource_dirs = [ "apk/java/res" ]
  custom_package = system_webview_package_name
}

android_resources("resources") {
  resource_dirs = [ "java/res" ]
  custom_package = "org.chromium.android_webview"
  deps = [
    ":locale_paks",
    ":strings_grd",
  ]
}

grit("generate_aw_resources") {
  source = "ui/aw_resources.grd"
  outputs = [
    "grit/aw_resources.h",
    "aw_resources.pak",
  ]
}

grit("generate_aw_strings") {
  source = "ui/aw_strings.grd"
  outputs = [
    "grit/aw_strings.h",
    "aw_strings_am.pak",
    "aw_strings_ar.pak",
    "aw_strings_bg.pak",
    "aw_strings_bn.pak",
    "aw_strings_ca.pak",
    "aw_strings_cs.pak",
    "aw_strings_da.pak",
    "aw_strings_de.pak",
    "aw_strings_el.pak",
    "aw_strings_en-US.pak",
    "aw_strings_en-GB.pak",
    "aw_strings_es.pak",
    "aw_strings_es-419.pak",
    "aw_strings_et.pak",
    "aw_strings_fa.pak",
    "aw_strings_fi.pak",
    "aw_strings_fil.pak",
    "aw_strings_fr.pak",
    "aw_strings_gu.pak",
    "aw_strings_he.pak",
    "aw_strings_hi.pak",
    "aw_strings_hr.pak",
    "aw_strings_hu.pak",
    "aw_strings_id.pak",
    "aw_strings_it.pak",
    "aw_strings_ja.pak",
    "aw_strings_kn.pak",
    "aw_strings_ko.pak",
    "aw_strings_lt.pak",
    "aw_strings_lv.pak",
    "aw_strings_ml.pak",
    "aw_strings_mr.pak",
    "aw_strings_ms.pak",
    "aw_strings_nl.pak",
    "aw_strings_nb.pak",
    "aw_strings_pl.pak",
    "aw_strings_pt-BR.pak",
    "aw_strings_pt-PT.pak",
    "aw_strings_ro.pak",
    "aw_strings_ru.pak",
    "aw_strings_sk.pak",
    "aw_strings_sl.pak",
    "aw_strings_sr.pak",
    "aw_strings_sv.pak",
    "aw_strings_sw.pak",
    "aw_strings_ta.pak",
    "aw_strings_te.pak",
    "aw_strings_th.pak",
    "aw_strings_tr.pak",
    "aw_strings_uk.pak",
    "aw_strings_vi.pak",
    "aw_strings_zh-CN.pak",
    "aw_strings_zh-TW.pak",
  ]
}

grit("generate_components_strings") {
  source = "../components/components_strings.grd"

  # components_strings contains strings from all components. WebView
  # will never display most of them, so we try to limit the included
  # strings
  whitelist = rebase_path("ui/grit_components_whitelist.txt")
  inputs = [
    whitelist,
  ]
  grit_flags = [
    "-w",
    whitelist,
  ]
  outputs = [
    "grit/components_strings.h",
    "components_strings_am.pak",
    "components_strings_ar.pak",
    "components_strings_bg.pak",
    "components_strings_bn.pak",
    "components_strings_ca.pak",
    "components_strings_cs.pak",
    "components_strings_da.pak",
    "components_strings_de.pak",
    "components_strings_el.pak",
    "components_strings_en-GB.pak",
    "components_strings_en-US.pak",
    "components_strings_es.pak",
    "components_strings_es-419.pak",
    "components_strings_et.pak",
    "components_strings_fa.pak",
    "components_strings_fake-bidi.pak",
    "components_strings_fi.pak",
    "components_strings_fil.pak",
    "components_strings_fr.pak",
    "components_strings_gu.pak",
    "components_strings_he.pak",
    "components_strings_hi.pak",
    "components_strings_hr.pak",
    "components_strings_hu.pak",
    "components_strings_id.pak",
    "components_strings_it.pak",
    "components_strings_ja.pak",
    "components_strings_kn.pak",
    "components_strings_ko.pak",
    "components_strings_lt.pak",
    "components_strings_lv.pak",
    "components_strings_ml.pak",
    "components_strings_mr.pak",
    "components_strings_ms.pak",
    "components_strings_nl.pak",
    "components_strings_nb.pak",
    "components_strings_pl.pak",
    "components_strings_pt-BR.pak",
    "components_strings_pt-PT.pak",
    "components_strings_ro.pak",
    "components_strings_ru.pak",
    "components_strings_sk.pak",
    "components_strings_sl.pak",
    "components_strings_sr.pak",
    "components_strings_sv.pak",
    "components_strings_sw.pak",
    "components_strings_ta.pak",
    "components_strings_te.pak",
    "components_strings_th.pak",
    "components_strings_tr.pak",
    "components_strings_uk.pak",
    "components_strings_vi.pak",
    "components_strings_zh-CN.pak",
    "components_strings_zh-TW.pak",
    "java/res/values-am/components_strings.xml",
    "java/res/values-ar/components_strings.xml",
    "java/res/values-bg/components_strings.xml",
    "java/res/values-ca/components_strings.xml",
    "java/res/values-cs/components_strings.xml",
    "java/res/values-da/components_strings.xml",
    "java/res/values-de/components_strings.xml",
    "java/res/values-el/components_strings.xml",
    "java/res/values-en-rGB/components_strings.xml",
    "java/res/values-es-rUS/components_strings.xml",
    "java/res/values-es/components_strings.xml",
    "java/res/values-fa/components_strings.xml",
    "java/res/values-fi/components_strings.xml",
    "java/res/values-fr/components_strings.xml",
    "java/res/values-hi/components_strings.xml",
    "java/res/values-hr/components_strings.xml",
    "java/res/values-hu/components_strings.xml",
    "java/res/values-in/components_strings.xml",
    "java/res/values-it/components_strings.xml",
    "java/res/values-iw/components_strings.xml",
    "java/res/values-ja/components_strings.xml",
    "java/res/values-ko/components_strings.xml",
    "java/res/values-lt/components_strings.xml",
    "java/res/values-lv/components_strings.xml",
    "java/res/values-nb/components_strings.xml",
    "java/res/values-nl/components_strings.xml",
    "java/res/values-pl/components_strings.xml",
    "java/res/values-pt-rBR/components_strings.xml",
    "java/res/values-pt-rPT/components_strings.xml",
    "java/res/values-ro/components_strings.xml",
    "java/res/values-ru/components_strings.xml",
    "java/res/values-sk/components_strings.xml",
    "java/res/values-sl/components_strings.xml",
    "java/res/values-sr/components_strings.xml",
    "java/res/values-sv/components_strings.xml",
    "java/res/values-sw/components_strings.xml",
    "java/res/values-th/components_strings.xml",
    "java/res/values-tl/components_strings.xml",
    "java/res/values-tr/components_strings.xml",
    "java/res/values-uk/components_strings.xml",
    "java/res/values-vi/components_strings.xml",
    "java/res/values-zh-rCN/components_strings.xml",
    "java/res/values-zh-rTW/components_strings.xml",
    "java/res/values/components_strings.xml",
  ]
}

shared_library("libwebviewchromium") {
  deps = [
    ":common",
  ]
  sources = [
    "lib/main/webview_entry_point.cc",
  ]
  configs -= [ "//build/config/android:hide_native_jni_exports" ]
}

source_set("common") {
  sources = [
    "browser/aw_browser_context.cc",
    "browser/aw_browser_context.h",
    "browser/aw_browser_main_parts.cc",
    "browser/aw_browser_main_parts.h",
    "browser/aw_browser_permission_request_delegate.h",
    "browser/aw_browser_policy_connector.cc",
    "browser/aw_browser_policy_connector.h",
    "browser/aw_content_browser_client.cc",
    "browser/aw_content_browser_client.h",
    "browser/aw_contents_client_bridge_base.cc",
    "browser/aw_contents_client_bridge_base.h",
    "browser/aw_contents_io_thread_client.h",
    "browser/aw_cookie_access_policy.cc",
    "browser/aw_cookie_access_policy.h",
    "browser/aw_dev_tools_discovery_provider.cc",
    "browser/aw_dev_tools_discovery_provider.h",
    "browser/aw_download_manager_delegate.cc",
    "browser/aw_download_manager_delegate.h",
    "browser/aw_form_database_service.cc",
    "browser/aw_form_database_service.h",
    "browser/aw_gl_surface.cc",
    "browser/aw_gl_surface.h",
    "browser/aw_http_auth_handler_base.cc",
    "browser/aw_http_auth_handler_base.h",
    "browser/aw_javascript_dialog_manager.cc",
    "browser/aw_javascript_dialog_manager.h",
    "browser/aw_locale_manager.h",
    "browser/aw_login_delegate.cc",
    "browser/aw_login_delegate.h",
    "browser/aw_media_client_android.cc",
    "browser/aw_media_client_android.h",
    "browser/aw_message_port_message_filter.cc",
    "browser/aw_message_port_message_filter.h",
    "browser/aw_message_port_service.h",
    "browser/aw_metrics_service_client.cc",
    "browser/aw_metrics_service_client.h",
    "browser/aw_permission_manager.cc",
    "browser/aw_permission_manager.h",
    "browser/aw_pref_store.cc",
    "browser/aw_pref_store.h",
    "browser/aw_print_manager.cc",
    "browser/aw_print_manager.h",
    "browser/aw_printing_message_filter.cc",
    "browser/aw_printing_message_filter.h",
    "browser/aw_quota_manager_bridge.cc",
    "browser/aw_quota_manager_bridge.h",
    "browser/aw_quota_permission_context.cc",
    "browser/aw_quota_permission_context.h",
    "browser/aw_render_thread_context_provider.cc",
    "browser/aw_render_thread_context_provider.h",
    "browser/aw_resource_context.cc",
    "browser/aw_resource_context.h",
    "browser/aw_result_codes.h",
    "browser/aw_ssl_host_state_delegate.cc",
    "browser/aw_ssl_host_state_delegate.h",
    "browser/aw_web_preferences_populater.cc",
    "browser/aw_web_preferences_populater.h",
    "browser/browser_view_renderer.cc",
    "browser/browser_view_renderer.h",
    "browser/browser_view_renderer_client.h",
    "browser/child_frame.cc",
    "browser/child_frame.h",
    "browser/deferred_gpu_command_service.cc",
    "browser/deferred_gpu_command_service.h",
    "browser/find_helper.cc",
    "browser/find_helper.h",
    "browser/gl_view_renderer_manager.cc",
    "browser/gl_view_renderer_manager.h",
    "browser/hardware_renderer.cc",
    "browser/hardware_renderer.h",
    "browser/icon_helper.cc",
    "browser/icon_helper.h",
    "browser/input_stream.h",
    "browser/jni_dependency_factory.h",
    "browser/net/android_stream_reader_url_request_job.cc",
    "browser/net/android_stream_reader_url_request_job.h",
    "browser/net/aw_cookie_store_wrapper.cc",
    "browser/net/aw_cookie_store_wrapper.h",
    "browser/net/aw_http_user_agent_settings.cc",
    "browser/net/aw_http_user_agent_settings.h",
    "browser/net/aw_network_change_notifier.cc",
    "browser/net/aw_network_change_notifier.h",
    "browser/net/aw_network_change_notifier_factory.cc",
    "browser/net/aw_network_change_notifier_factory.h",
    "browser/net/aw_network_delegate.cc",
    "browser/net/aw_network_delegate.h",
    "browser/net/aw_request_interceptor.cc",
    "browser/net/aw_request_interceptor.h",
    "browser/net/aw_url_request_context_getter.cc",
    "browser/net/aw_url_request_context_getter.h",
    "browser/net/aw_url_request_job_factory.cc",
    "browser/net/aw_url_request_job_factory.h",
    "browser/net/aw_web_resource_response.h",
    "browser/net/init_native_callback.h",
    "browser/net/input_stream_reader.cc",
    "browser/net/input_stream_reader.h",
    "browser/net/token_binding_manager.cc",
    "browser/net/token_binding_manager.h",
    "browser/net_disk_cache_remover.cc",
    "browser/net_disk_cache_remover.h",
    "browser/parent_compositor_draw_constraints.cc",
    "browser/parent_compositor_draw_constraints.h",
    "browser/parent_output_surface.cc",
    "browser/parent_output_surface.h",
    "browser/renderer_host/aw_render_view_host_ext.cc",
    "browser/renderer_host/aw_render_view_host_ext.h",
    "browser/renderer_host/aw_resource_dispatcher_host_delegate.cc",
    "browser/renderer_host/aw_resource_dispatcher_host_delegate.h",
    "browser/scoped_allow_wait_for_legacy_web_view_api.h",
    "browser/scoped_app_gl_state_restore.cc",
    "browser/scoped_app_gl_state_restore.h",
    "browser/shared_renderer_state.cc",
    "browser/shared_renderer_state.h",
    "common/android_webview_message_generator.cc",
    "common/android_webview_message_generator.h",
    "common/aw_content_client.cc",
    "common/aw_content_client.h",
    "common/aw_descriptors.h",
    "common/aw_hit_test_data.cc",
    "common/aw_hit_test_data.h",
    "common/aw_message_port_messages.h",
    "common/aw_resource.h",
    "common/aw_switches.cc",
    "common/aw_switches.h",
    "common/devtools_instrumentation.h",
    "common/render_view_messages.cc",
    "common/render_view_messages.h",
    "common/url_constants.cc",
    "common/url_constants.h",
    "crash_reporter/aw_microdump_crash_reporter.cc",
    "crash_reporter/aw_microdump_crash_reporter.h",
    "lib/aw_browser_dependency_factory_impl.cc",
    "lib/aw_browser_dependency_factory_impl.h",
    "lib/main/aw_main_delegate.cc",
    "lib/main/aw_main_delegate.h",
    "lib/main/webview_jni_onload.cc",
    "lib/main/webview_jni_onload.h",
    "public/browser/draw_gl.h",
    "renderer/aw_content_renderer_client.cc",
    "renderer/aw_content_renderer_client.h",
    "renderer/aw_content_settings_client.cc",
    "renderer/aw_content_settings_client.h",
    "renderer/aw_key_systems.cc",
    "renderer/aw_key_systems.h",
    "renderer/aw_message_port_client.cc",
    "renderer/aw_message_port_client.h",
    "renderer/aw_print_web_view_helper_delegate.cc",
    "renderer/aw_print_web_view_helper_delegate.h",
    "renderer/aw_render_frame_ext.cc",
    "renderer/aw_render_frame_ext.h",
    "renderer/aw_render_process_observer.cc",
    "renderer/aw_render_process_observer.h",
    "renderer/aw_render_view_ext.cc",
    "renderer/aw_render_view_ext.h",
    "renderer/print_render_frame_observer.cc",
    "renderer/print_render_frame_observer.h",
  ]

  deps = [
    ":generate_aw_resources",
    ":generate_aw_strings",
    ":generate_components_strings",
    "//android_webview/common:version",
    "//android_webview/native:native",
    "//cc/surfaces",
    "//components/auto_login_parser:auto_login_parser",
    "//components/autofill/content/renderer",
    "//components/cdm/browser",
    "//components/cdm/renderer",
    "//components/crash/content/app",
    "//components/crash/content/browser",
    "//components/data_reduction_proxy/core/browser",
    "//components/devtools_discovery",
    "//components/metrics",
    "//components/metrics:gpu",
    "//components/metrics:net",
    "//components/metrics:profiler",
    "//components/metrics:ui",
    "//components/navigation_interception",
    "//components/printing/browser",
    "//components/printing/common",
    "//components/printing/renderer",
    "//components/visitedlink/browser",
    "//components/visitedlink/renderer",
    "//components/web_contents_delegate_android:web_contents_delegate_android",
    "//content",
    "//content/public/app:both",
    "//content/public/browser",
    "//gin",
    "//gpu/blink",
    "//gpu/command_buffer/client:gl_in_process_context",
    "//gpu/command_buffer/client:gles2_c_lib",
    "//gpu/command_buffer/client:gles2_implementation",
    "//gpu/command_buffer/common:gles2_utils",
    "//gpu/command_buffer/service",
    "//gpu/skia_bindings",
    "//media",
    "//media/midi",
    "//net:extras",
    "//printing",
    "//skia",
    "//third_party/WebKit/public:blink",
    "//ui/events:gesture_detection",
    "//ui/gl",
    "//ui/shell_dialogs",
    "//v8",
  ]

  if (enable_configuration_policy) {
    deps += [
      "//components/policy",
      "//components/policy:policy_component",
    ]
  }

  configs += [ "//v8:external_startup_data" ]
}

android_library("android_webview_java") {
  java_files = [
    "java/src/org/chromium/android_webview/AndroidProtocolHandler.java",
    "java/src/org/chromium/android_webview/AwAutofillClient.java",
    "java/src/org/chromium/android_webview/AwBrowserContext.java",
    "java/src/org/chromium/android_webview/AwBrowserProcess.java",
    "java/src/org/chromium/android_webview/AwContentViewClient.java",
    "java/src/org/chromium/android_webview/AwContents.java",
    "java/src/org/chromium/android_webview/AwContentsBackgroundThreadClient.java",
    "java/src/org/chromium/android_webview/AwContentsClient.java",
    "java/src/org/chromium/android_webview/AwContentsClientBridge.java",
    "java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java",
    "java/src/org/chromium/android_webview/AwContentsIoThreadClient.java",
    "java/src/org/chromium/android_webview/AwContentsLifecycleNotifier.java",
    "java/src/org/chromium/android_webview/AwContentsStatics.java",
    "java/src/org/chromium/android_webview/AwCookieManager.java",
    "java/src/org/chromium/android_webview/AwDataReductionProxyManager.java",
    "java/src/org/chromium/android_webview/AwDebug.java",
    "java/src/org/chromium/android_webview/AwDevToolsServer.java",
    "java/src/org/chromium/android_webview/AwFormDatabase.java",
    "java/src/org/chromium/android_webview/AwGeolocationPermissions.java",
    "java/src/org/chromium/android_webview/AwHttpAuthHandler.java",
    "java/src/org/chromium/android_webview/AwLayoutSizer.java",
    "java/src/org/chromium/android_webview/AwMessagePort.java",
    "java/src/org/chromium/android_webview/AwMessagePortService.java",
    "java/src/org/chromium/android_webview/AwMetricsServiceClient.java",
    "java/src/org/chromium/android_webview/AwNetworkChangeNotifierRegistrationPolicy.java",
    "java/src/org/chromium/android_webview/AwPdfExporter.java",
    "java/src/org/chromium/android_webview/AwPicture.java",
    "java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java",
    "java/src/org/chromium/android_webview/AwQuotaManagerBridge.java",
    "java/src/org/chromium/android_webview/AwResource.java",
    "java/src/org/chromium/android_webview/AwScrollOffsetManager.java",
    "java/src/org/chromium/android_webview/AwServiceWorkerClient.java",
    "java/src/org/chromium/android_webview/AwServiceWorkerController.java",
    "java/src/org/chromium/android_webview/AwServiceWorkerSettings.java",
    "java/src/org/chromium/android_webview/AwSettings.java",
    "java/src/org/chromium/android_webview/AwSwitches.java",
    "java/src/org/chromium/android_webview/AwTokenBindingManager.java",
    "java/src/org/chromium/android_webview/AwViewMethods.java",
    "java/src/org/chromium/android_webview/AwWebContentsDelegate.java",
    "java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java",
    "java/src/org/chromium/android_webview/AwWebContentsObserver.java",
    "java/src/org/chromium/android_webview/AwWebResourceResponse.java",
    "java/src/org/chromium/android_webview/AwZoomControls.java",
    "java/src/org/chromium/android_webview/ClientCertLookupTable.java",
    "java/src/org/chromium/android_webview/DefaultVideoPosterRequestHandler.java",
    "java/src/org/chromium/android_webview/ErrorCodeConversionHelper.java",
    "java/src/org/chromium/android_webview/FullScreenView.java",
    "java/src/org/chromium/android_webview/HttpAuthDatabase.java",
    "java/src/org/chromium/android_webview/InputStreamUtil.java",
    "java/src/org/chromium/android_webview/JavaBrowserViewRendererHelper.java",
    "java/src/org/chromium/android_webview/JsPromptResultReceiver.java",
    "java/src/org/chromium/android_webview/JsResultHandler.java",
    "java/src/org/chromium/android_webview/JsResultReceiver.java",
    "java/src/org/chromium/android_webview/NullAwViewMethods.java",
    "java/src/org/chromium/android_webview/OverScrollGlow.java",
    "java/src/org/chromium/android_webview/PlatformServiceBridge.java",
    "java/src/org/chromium/android_webview/PostMessageSender.java",
    "java/src/org/chromium/android_webview/ScrollAccessibilityHelper.java",
    "java/src/org/chromium/android_webview/SslUtil.java",
    "java/src/org/chromium/android_webview/permission/AwGeolocationCallback.java",
    "java/src/org/chromium/android_webview/permission/AwPermissionRequest.java",
    "java/src/org/chromium/android_webview/policy/AwPolicyProvider.java",
  ]
  deps = [
    ":resources",
    ":strings_grd",
    "//base:base_java",
    "//components/external_video_surface:java",
    "//components/navigation_interception/android:navigation_interception_java",
    "//components/web_contents_delegate_android:web_contents_delegate_android_java",
    "//content/public/android:content_java",
    "//net/android:net_java",
    "//ui/android:ui_java",
  ]

  if (enable_configuration_policy) {
    deps += [ "//components/policy/android:policy_java" ]
  }

  srcjar_deps = [ "//android_webview/native:aw_permission_request_resource" ]
}

java_strings_grd("strings_grd") {
  grd_file = "java/strings/android_webview_strings.grd"
  outputs = [
    "values-am/android_webview_strings.xml",
    "values-ar/android_webview_strings.xml",
    "values-bg/android_webview_strings.xml",
    "values-ca/android_webview_strings.xml",
    "values-cs/android_webview_strings.xml",
    "values-da/android_webview_strings.xml",
    "values-de/android_webview_strings.xml",
    "values-el/android_webview_strings.xml",
    "values-en-rGB/android_webview_strings.xml",
    "values-es-rUS/android_webview_strings.xml",
    "values-es/android_webview_strings.xml",
    "values-fa/android_webview_strings.xml",
    "values-fi/android_webview_strings.xml",
    "values-fr/android_webview_strings.xml",
    "values-hi/android_webview_strings.xml",
    "values-hr/android_webview_strings.xml",
    "values-hu/android_webview_strings.xml",
    "values-in/android_webview_strings.xml",
    "values-it/android_webview_strings.xml",
    "values-iw/android_webview_strings.xml",
    "values-ja/android_webview_strings.xml",
    "values-ko/android_webview_strings.xml",
    "values-lt/android_webview_strings.xml",
    "values-lv/android_webview_strings.xml",
    "values-nb/android_webview_strings.xml",
    "values-nl/android_webview_strings.xml",
    "values-pl/android_webview_strings.xml",
    "values-pt-rBR/android_webview_strings.xml",
    "values-pt-rPT/android_webview_strings.xml",
    "values-ro/android_webview_strings.xml",
    "values-ru/android_webview_strings.xml",
    "values-sk/android_webview_strings.xml",
    "values-sl/android_webview_strings.xml",
    "values-sr/android_webview_strings.xml",
    "values-sv/android_webview_strings.xml",
    "values-sw/android_webview_strings.xml",
    "values-th/android_webview_strings.xml",
    "values-tl/android_webview_strings.xml",
    "values-tr/android_webview_strings.xml",
    "values-uk/android_webview_strings.xml",
    "values-vi/android_webview_strings.xml",
    "values-zh-rCN/android_webview_strings.xml",
    "values-zh-rTW/android_webview_strings.xml",
    "values/android_webview_strings.xml",
  ]
}

if (!use_webview_internal_framework) {
  system_webview_apk_tmpl("system_webview_apk") {
    android_manifest = get_target_outputs(":system_webview_manifest")
    android_manifest = android_manifest[1]
    android_manifest_dep = ":system_webview_manifest"
    deps = [
      ":system_webview_resources",
      "//android_webview/glue",
    ]
    apk_name = "SystemWebView"
  }
}