0
Commit Graph

18 Commits

Author SHA1 Message Date
Trevor Perrier
01b8fb7948 Reland "[Android] add sr-Latn to locales.gni and resource packs"
This reverts commit 0c8db37070.

Reason for revert:

This CL was paired with one downstream that must land together.
Unfortunately, the Canary auto-roller did not catch the downstream
CL and thus broke the build.

Downstream has been patched to not directly rely on
|androind_bundle_locales_as_resources| in build/config/locales.gni.

This CL is no longer part of a double sided patch and can safely be
merged independently now.

This CL introduces a small binary size increase from adding a new
locale. The SuperSize diff tool reports an increase or 10.68KB in
resources.arsc.

Original change's description:
> Revert "[Android] add sr-Latn to locales.gni and resource packs"
>
> This reverts commit a3fe6f0543.
>
> Reason for revert: Caused build failure: https://ci.chromium.org/p/chrome/builders/ci/android-builder-perf/176320
>
> Original change's description:
> > [Android] add sr-Latn to locales.gni and resource packs
> >
> > This CL adds the sr-Latn translations to resource packs for Android
> > bundle builds.  The sr-Latn translations were added in [1].
> >
> > This CL introduces a small binary size increase from adding a new
> > locale. The SuperSize diff tool reports an increase or 10.68KB in
> > resources.arsc.
> >
> > [1] https://crrev.com/c/2121076
> >
> > Binary-Size: Size increase is unavoidable (see above).
> > Bug: 1053811
> > Change-Id: I5a04ff69ade3818ee8ce6c84dd1760c985c1de1f
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132600
> > Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> > Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> > Reviewed-by: Megan Jablonski <megjablon@chromium.org>
> > Commit-Queue: Trevor  Perrier <perrier@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#761135}
>
> TBR=yfriedman@chromium.org,agrieve@chromium.org,megjablon@chromium.org,perrier@chromium.org
>
> Change-Id: I4e4dee37eef11f2f81624e2130ab6d17ca4bbf5f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1053811
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2159179
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#761281}

TBR=yfriedman@chromium.org,agrieve@chromium.org,megjablon@chromium.org,rakina@chromium.org,perrier@chromium.org

Change-Id: Id6da70ae6e918ec42966cc1967a4b44c50e86da4
Bug: 1053811
Binary-Size: Size increase is unavoidable (see above).
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2161933
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Megan Jablonski <megjablon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766195}
2020-05-06 23:08:12 +00:00
Rakina Zata Amni
0c8db37070 Revert "[Android] add sr-Latn to locales.gni and resource packs"
This reverts commit a3fe6f0543.

Reason for revert: Caused build failure: https://ci.chromium.org/p/chrome/builders/ci/android-builder-perf/176320

Original change's description:
> [Android] add sr-Latn to locales.gni and resource packs
> 
> This CL adds the sr-Latn translations to resource packs for Android
> bundle builds.  The sr-Latn translations were added in [1].
> 
> This CL introduces a small binary size increase from adding a new
> locale. The SuperSize diff tool reports an increase or 10.68KB in
> resources.arsc.
> 
> [1] https://crrev.com/c/2121076
> 
> Binary-Size: Size increase is unavoidable (see above).
> Bug: 1053811
> Change-Id: I5a04ff69ade3818ee8ce6c84dd1760c985c1de1f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132600
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> Reviewed-by: Megan Jablonski <megjablon@chromium.org>
> Commit-Queue: Trevor  Perrier <perrier@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#761135}

TBR=yfriedman@chromium.org,agrieve@chromium.org,megjablon@chromium.org,perrier@chromium.org

Change-Id: I4e4dee37eef11f2f81624e2130ab6d17ca4bbf5f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1053811
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2159179
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#761281}
2020-04-22 02:56:58 +00:00
Trevor Perrier
a3fe6f0543 [Android] add sr-Latn to locales.gni and resource packs
This CL adds the sr-Latn translations to resource packs for Android
bundle builds.  The sr-Latn translations were added in [1].

This CL introduces a small binary size increase from adding a new
locale. The SuperSize diff tool reports an increase or 10.68KB in
resources.arsc.

[1] https://crrev.com/c/2121076

Binary-Size: Size increase is unavoidable (see above).
Bug: 1053811
Change-Id: I5a04ff69ade3818ee8ce6c84dd1760c985c1de1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132600
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Megan Jablonski <megjablon@chromium.org>
Commit-Queue: Trevor  Perrier <perrier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#761135}
2020-04-21 21:31:15 +00:00
Elly Fong-Jones
5aa6f4898f cbuiv: migrate a few more Accept/Cancel overrides
This change:
1) Migrates ExtensionInstallDialogView to OnDialog* methods and removes
   the handled_result_ instance var, which is redundant with the
   presence of the callback
2) Migrates ExtensionUninstallDialogDelegateView to lambdas
3) Migrates ImportLockDialogView to lambdas with a close callback
4) Migrates PaymentRequestDialogView to OnDialog* methods
5) Migrates PlatformKeysCertificateSelector to a lambda
6) Migrates WebAppUninstallDialogDelegateView to OnDialog* methods
7) Migrates AppModalDialogViewViews to lambdas with a close callback

For each dialog I attempted a manual inspection to figure out whether a
close callback is needed or not.

Bug: 1011446
Change-Id: I038371177d932546afe556f9f0665f841bb95e7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2135711
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757957}
2020-04-09 19:30:27 +00:00
Krishna Govind
743a4c1dfe Updating XTBs based on .GRDs from branch master
TBR=benmason@chromium.org

Change-Id: I9e67f0a246dc8532942caf6265aa287a0697e100
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2131361
Commit-Queue: Krishna Govind <govind@chromium.org>
Reviewed-by: Krishna Govind <govind@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755282}
2020-04-01 08:21:33 +00:00
Trevor Perrier
634b745e61 add empty sr-Latn xtb files for import
This CL adds empty xtb files for sr-Latn and adds sr-Latn to the
translation_expectations.pyl file. On the next TC import the Latin script
for Serbian should be imported into all xtb files.

Bug: 1053811
Change-Id: I271e2e8ae042f085d962eb62ae3d4ad03ecf9190
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2121076
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Megan Jablonski <megjablon@chromium.org>
Commit-Queue: Trevor  Perrier <perrier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755218}
2020-04-01 02:32:03 +00:00
Vasiliy Telezhnikov
14b151d506 [Refactoring] Migrate resource_dirs => sources
This CL converts resource_dirs to sources for android_resources in
BUILD.gn files in components and ui.

Details:
https://crbug.com/1026378
https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/KAFsfaoq7y4/OC4v5sb9BQAJ

Bug: 1062263
Change-Id: I50542a81d1fa7f08e4664334a87353bfc389982e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2115551
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752497}
2020-03-23 17:56:28 +00:00
Scott Violet
90ef8c2f3c [reland] weblayer: fixes strict mode issues for weblayer
This fixs a number of cases and enables strict mode in tests. Hopefully
that helps prevent any other access from being added.

The trickier cases are jacoco injects code that accesses the disk, and
LayoutInflater may trigger loading classes, which triggers disk
access.

The addition since first patch is SelectFileDialog may trigger reading
from disk. That file has been updated.

BUG=1059770,1062561
TEST=covered by tests now

Change-Id: Ie8262ae4e018055049115fcefc6a29bf97acbe9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108603
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751465}
2020-03-18 20:34:35 +00:00
Arthur Sonzogni
00e24aa245 Revert "weblayer: fixes strict mode issues for weblayer"
This reverts commit e245bb7a9d.

Reason for revert: several tests are failing: See:
https://crbug.com/1062561
https://crbug.com/1062554

Original change's description:
> weblayer: fixes strict mode issues for weblayer
> 
> This fixs a number of cases and enables strict mode in tests. Hopefully
> that helps prevent any other access from being added.
> 
> The trickier cases are jacoco injects code that accesses the disk, and
> LayoutInflater may trigger loading classes, which triggers disk
> access.
> 
> BUG=1059770
> TEST=covered by tests now
> 
> Change-Id: I50f81836f838b023fe09fd5f760cb7484edd8d26
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2100589
> Commit-Queue: Scott Violet <sky@chromium.org>
> Reviewed-by: Bo <boliu@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#751028}

TBR=sky@chromium.org,boliu@chromium.org

Change-Id: I3405b415b69cbb3cb0e417ac38caae608356101b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1059770, 1062561, 1062554
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2107586
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751267}
2020-03-18 09:15:07 +00:00
Scott Violet
e245bb7a9d weblayer: fixes strict mode issues for weblayer
This fixs a number of cases and enables strict mode in tests. Hopefully
that helps prevent any other access from being added.

The trickier cases are jacoco injects code that accesses the disk, and
LayoutInflater may trigger loading classes, which triggers disk
access.

BUG=1059770
TEST=covered by tests now

Change-Id: I50f81836f838b023fe09fd5f760cb7484edd8d26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2100589
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751028}
2020-03-17 17:57:59 +00:00
Elly Fong-Jones
18ca2de542 views: rename some DialogDelegate methods
This change renames:
* set_default_button -> SetDefaultButton
* set_buttons -> SetButtons
* set_button_label -> SetButtonLabel
* set_accept_callback -> SetAcceptCallback
* set_cancel_callback -> SetCancelCallback
* set_close_callback -> SetCloseCallback

so that these methods can start having side-effects (specifically, some
consistency DCHECKs).

This change was generated by this shell script:
  #!/bin/sh

  DD=DialogDelegate

  find . -type f -name '*.cc' -o -name '*.h' -o -name '*.mm' | \
    xargs sed -i \
    -e "s/$DD::set_default_button/$DD::SetDefaultButton/g" \
    -e "s/$DD::set_buttons/$DD::SetButtons/g" \
    -e "s/$DD::set_button_label/$DD::SetButtonLabel/g" \
    -e "s/$DD::set_accept_callback/$DD::SetAcceptCallback/g" \
    -e "s/$DD::set_cancel_callback/$DD::SetCancelCallback/g" \
    -e "s/$DD::set_close_callback/$DD::SetCloseCallback/g"

with a tiny amount of manual fixing-up afterwards.

Bug: 1011446
Change-Id: Ic9d34ac05c759e9bcb0bd2ce3d26d2fc0dd2f611
Tbr: joedow@chromium.org,avi@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2099084
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750206}
2020-03-13 17:06:59 +00:00
Gabriel Charette
9f60dd1181 Reland "IWYU for bind/callback_helpers.h and ptr_util.h"
This reverts commit 7a13e2645a.

Reason for revert: same as original % tools/clang

Original change's description:
> Revert "IWYU for bind/callback_helpers.h and ptr_util.h"
> 
> This reverts commit b8ffaf4cfc.
> 
> Reason for revert:
> This broke the build of the blink_gc_plugin, which does not use base/
> (see bug). Please don't commit to tools/clang/ without review.
> 
> Original change's description:
> > IWYU for bind/callback_helpers.h and ptr_util.h
> > 
> > These missing includes are preventing removal of unused headers from
> > task_runner_util.h and consequently migration from task_runner_util.h to
> > task_runner.h's new PostTaskAndReplyWithResult member method.
> > 
> > The following script was run on every file in the codebase, prioritizing
> > .h over matching .cc to best enforce the rule of not include a header
> > included by your .h :
> > 
> > def Fix(file_path):
> >   content = refactor_lib.ReadFile(file_path)
> > 
> >   # Assume fwd-decls are correct in first pass.
> >   fwd_decls_match = re.compile(r'\n *[^/\n][^/\n][^/\n]*class (NullCallback|DoNothing|ScopedClosureRunner);', re.DOTALL).findall(content)
> >   if fwd_decls_match:
> >     print 'fwd_decls_match in %s' % (file_path)
> >     return False
> > 
> >   bind_helpers_match = re.compile(
> >       # Doesn't begin with a comment.
> >       r'\n *[^/\n][^/\n]'
> >       # Anything else after a non-comment start (and don't allow this to capture a comment start either)
> >       r'[^/\n]*'
> >       # Anything before but an open angle-bracket to avoid cases like unique_ptr<Foo> where you don't need the full definition of Foo.
> >       r'[^<]'
> >       # Only match with base:: prefix; more precise, can manually fix missing includes in //base proper in a follow-up pass if needed.
> >       r'base::(NullCallback|DoNothing|DeletePointer)\b[^*]', re.DOTALL).findall(content)
> > 
> >   callback_helpers_match = re.compile(r'\n *[^/\n][^/\n][^/\n]*[^<]base::(IsBaseCallback|EnableIfIsBaseCallback|AdaptCallbackForRepeating|ScopedClosureRunner)\b[^*]', re.DOTALL).findall(content)
> > 
> >   ptr_util_match = re.compile(r'\n *[^/\n][^/\n][^/\n]*[^<]base::WrapUnique\b[^*]', re.DOTALL).findall(content)
> > 
> >   if not bind_helpers_match and not callback_helpers_match and not ptr_util_match:
> >     return False
> > 
> >   updated_content = content
> >   if bind_helpers_match:
> >     updated_content = refactor_lib.AddInclude(file_path, updated_content, "base/bind_helpers.h")
> >   if callback_helpers_match:
> >     updated_content = refactor_lib.AddInclude(file_path, updated_content, "base/callback_helpers.h")
> >   if ptr_util_match:
> >     updated_content = refactor_lib.AddInclude(file_path, updated_content, "base/memory/ptr_util.h")
> > 
> >   if updated_content == content:
> >     return False
> > 
> >   # Write updated file
> >   refactor_lib.WriteFile(file_path, updated_content)
> > 
> >   return True
> > 
> > TBR=danakj@chromium.org
> > (mechanical change for //base API)
> > 
> > Bug: 1026641
> > Change-Id: Ic88585c62dd2f74d34c59c708faeddb231aee47f
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087971
> > Reviewed-by: Gabriel Charette <gab@chromium.org>
> > Reviewed-by: danakj <danakj@chromium.org>
> > Commit-Queue: Gabriel Charette <gab@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#747685}
> 
> TBR=danakj@chromium.org,gab@chromium.org
> 
> Change-Id: I59d6cd69bd898e9f6d10922c67d8c24ba582bf7f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1026641, 1059359
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2091356
> Reviewed-by: Hans Wennborg <hans@chromium.org>
> Commit-Queue: Hans Wennborg <hans@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#747804}

TBR=danakj@chromium.org,gab@chromium.org,hans@chromium.org

Change-Id: I721391eba68ea55830dca4f1ac34ff633f714f72
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1026641, 1059359
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090509
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747844}
2020-03-06 20:48:04 +00:00
Hans Wennborg
7a13e2645a Revert "IWYU for bind/callback_helpers.h and ptr_util.h"
This reverts commit b8ffaf4cfc.

Reason for revert:
This broke the build of the blink_gc_plugin, which does not use base/
(see bug). Please don't commit to tools/clang/ without review.

Original change's description:
> IWYU for bind/callback_helpers.h and ptr_util.h
> 
> These missing includes are preventing removal of unused headers from
> task_runner_util.h and consequently migration from task_runner_util.h to
> task_runner.h's new PostTaskAndReplyWithResult member method.
> 
> The following script was run on every file in the codebase, prioritizing
> .h over matching .cc to best enforce the rule of not include a header
> included by your .h :
> 
> def Fix(file_path):
>   content = refactor_lib.ReadFile(file_path)
> 
>   # Assume fwd-decls are correct in first pass.
>   fwd_decls_match = re.compile(r'\n *[^/\n][^/\n][^/\n]*class (NullCallback|DoNothing|ScopedClosureRunner);', re.DOTALL).findall(content)
>   if fwd_decls_match:
>     print 'fwd_decls_match in %s' % (file_path)
>     return False
> 
>   bind_helpers_match = re.compile(
>       # Doesn't begin with a comment.
>       r'\n *[^/\n][^/\n]'
>       # Anything else after a non-comment start (and don't allow this to capture a comment start either)
>       r'[^/\n]*'
>       # Anything before but an open angle-bracket to avoid cases like unique_ptr<Foo> where you don't need the full definition of Foo.
>       r'[^<]'
>       # Only match with base:: prefix; more precise, can manually fix missing includes in //base proper in a follow-up pass if needed.
>       r'base::(NullCallback|DoNothing|DeletePointer)\b[^*]', re.DOTALL).findall(content)
> 
>   callback_helpers_match = re.compile(r'\n *[^/\n][^/\n][^/\n]*[^<]base::(IsBaseCallback|EnableIfIsBaseCallback|AdaptCallbackForRepeating|ScopedClosureRunner)\b[^*]', re.DOTALL).findall(content)
> 
>   ptr_util_match = re.compile(r'\n *[^/\n][^/\n][^/\n]*[^<]base::WrapUnique\b[^*]', re.DOTALL).findall(content)
> 
>   if not bind_helpers_match and not callback_helpers_match and not ptr_util_match:
>     return False
> 
>   updated_content = content
>   if bind_helpers_match:
>     updated_content = refactor_lib.AddInclude(file_path, updated_content, "base/bind_helpers.h")
>   if callback_helpers_match:
>     updated_content = refactor_lib.AddInclude(file_path, updated_content, "base/callback_helpers.h")
>   if ptr_util_match:
>     updated_content = refactor_lib.AddInclude(file_path, updated_content, "base/memory/ptr_util.h")
> 
>   if updated_content == content:
>     return False
> 
>   # Write updated file
>   refactor_lib.WriteFile(file_path, updated_content)
> 
>   return True
> 
> TBR=danakj@chromium.org
> (mechanical change for //base API)
> 
> Bug: 1026641
> Change-Id: Ic88585c62dd2f74d34c59c708faeddb231aee47f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087971
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: danakj <danakj@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#747685}

TBR=danakj@chromium.org,gab@chromium.org

Change-Id: I59d6cd69bd898e9f6d10922c67d8c24ba582bf7f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1026641, 1059359
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2091356
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747804}
2020-03-06 19:43:33 +00:00
Gabriel Charette
b8ffaf4cfc IWYU for bind/callback_helpers.h and ptr_util.h
These missing includes are preventing removal of unused headers from
task_runner_util.h and consequently migration from task_runner_util.h to
task_runner.h's new PostTaskAndReplyWithResult member method.

The following script was run on every file in the codebase, prioritizing
.h over matching .cc to best enforce the rule of not include a header
included by your .h :

def Fix(file_path):
  content = refactor_lib.ReadFile(file_path)

  # Assume fwd-decls are correct in first pass.
  fwd_decls_match = re.compile(r'\n *[^/\n][^/\n][^/\n]*class (NullCallback|DoNothing|ScopedClosureRunner);', re.DOTALL).findall(content)
  if fwd_decls_match:
    print 'fwd_decls_match in %s' % (file_path)
    return False

  bind_helpers_match = re.compile(
      # Doesn't begin with a comment.
      r'\n *[^/\n][^/\n]'
      # Anything else after a non-comment start (and don't allow this to capture a comment start either)
      r'[^/\n]*'
      # Anything before but an open angle-bracket to avoid cases like unique_ptr<Foo> where you don't need the full definition of Foo.
      r'[^<]'
      # Only match with base:: prefix; more precise, can manually fix missing includes in //base proper in a follow-up pass if needed.
      r'base::(NullCallback|DoNothing|DeletePointer)\b[^*]', re.DOTALL).findall(content)

  callback_helpers_match = re.compile(r'\n *[^/\n][^/\n][^/\n]*[^<]base::(IsBaseCallback|EnableIfIsBaseCallback|AdaptCallbackForRepeating|ScopedClosureRunner)\b[^*]', re.DOTALL).findall(content)

  ptr_util_match = re.compile(r'\n *[^/\n][^/\n][^/\n]*[^<]base::WrapUnique\b[^*]', re.DOTALL).findall(content)

  if not bind_helpers_match and not callback_helpers_match and not ptr_util_match:
    return False

  updated_content = content
  if bind_helpers_match:
    updated_content = refactor_lib.AddInclude(file_path, updated_content, "base/bind_helpers.h")
  if callback_helpers_match:
    updated_content = refactor_lib.AddInclude(file_path, updated_content, "base/callback_helpers.h")
  if ptr_util_match:
    updated_content = refactor_lib.AddInclude(file_path, updated_content, "base/memory/ptr_util.h")

  if updated_content == content:
    return False

  # Write updated file
  refactor_lib.WriteFile(file_path, updated_content)

  return True

TBR=danakj@chromium.org
(mechanical change for //base API)

Bug: 1026641
Change-Id: Ic88585c62dd2f74d34c59c708faeddb231aee47f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087971
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747685}
2020-03-06 14:08:36 +00:00
Allen Bauer
d66100ebd9 Revert "Use a virtual base class to provide GetWidget()."
This reverts commit b653a4a87f.

Reason for revert: Revert for testing whether the size regression disappears.

Original change's description:
> Use a virtual base class to provide GetWidget().
> 
> This addresses issues with:
> * Failure to override both GetWidget() variants
> * Having to override just to specify which base class provides the
>   implementation
> 
> Bug: none
> Change-Id: I87ec1f524d876e4488135ecbcff54aa9591e4e47
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1996948
> Commit-Queue: Peter Kasting <pkasting@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Allen Bauer <kylixrd@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#730791}

TBR=sky@chromium.org,pkasting@chromium.org,kylixrd@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: none
Change-Id: I507a2d57d53776df407461887ca06f34b656a885
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2044877
Reviewed-by: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739930}
2020-02-10 18:11:43 +00:00
Theresa Wellington
e66c244ff7 [Android] Remove dark mode build flag
Remove the dark mode build flag and merge res_night/ into normal res/
directory. Also removes the dark mode flag from about://flags.

BUG=936275

Change-Id: Icd8df11f94ef9ab6314c4a2fcd47ecab261985a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031877
Commit-Queue: Theresa  <twellington@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Peter Wen <wnwen@chromium.org>
Reviewed-by: Sinan Sahin <sinansahin@google.com>
Cr-Commit-Position: refs/heads/master@{#739206}
2020-02-07 01:17:26 +00:00
Evan Stade
4b55d202d3 Componentize tab modal javascript dialogs
Move cross-platform controller code as well as Android view code to
//components/javascript_dialogs. Rename some classes to better reflect
roles (controller, view, etc)

Bug: 1025256
Change-Id: I7150ef086dfa2e37621595074ac005d3e3cdec79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2033934
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Christopher Thompson <cthomp@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739003}
2020-02-06 17:29:06 +00:00
Evan Stade
7220e47a0e Rename components/app_modal to components/javascript_dialogs
The code in this component is unique to javascript dialogs, and does
not cover all app modals. Further, it has some view code that isn't
specifically for app modal javascript dialogs, but is re-used for tab
modals. Some tab modal code from //chrome will be moved here soon, so
rename from app_modal to javascript_dialogs. Class names reflect whether
their use is specific to the app modal control flow.

Also, rename some classes to better reflect their roles:

. JavaScriptDialogManager (implements content::JavaScriptDialogManager)
  => AppModalDialogManager

. JavaScriptAppModalDialog => AppModalDialogController

. NativeAppModalDialog => AppModalDialogView

etc.

Bug: 1025256
Change-Id: I0a1865ec71897ae6549184bc317ede29cc56438a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031936
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737355}
2020-01-31 17:06:57 +00:00