0
Commit Graph

8 Commits

Author SHA1 Message Date
c517460361 Support generation of flag attribute in java_cpp_enum.py
RefreshType in task_manager_observer.h is a real example of the enums
needing this handling. Unless we generate it with the flag attribute,
we can't concatenate the constants with `|`, seeing the error like this:

```
../../chrome/browser/task_manager/internal/android/java/src/org/chromium/chrome/browser/task_manager/TaskManagerActivity.java:32: Error: Flag not allowed here [WrongConstant]
                        observer, REFRESH_TIME_MS, RefreshType.MEMORY_FOOTPRINT | RefreshType.CPU);
```

Bug: 353596679
Change-Id: I382678b39dd9ff85e619cc1881eb087b463d22bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6034170
Auto-Submit: Keigo Oka <oka@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1384981}
2024-11-19 15:55:19 +00:00
048ea3976d Android: Make missing dep suggestions more copy / pasteable
Bug: None
Change-Id: I01b59489312ea1c367f50f3c229ea9396bd8b2fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3457782
Reviewed-by: Peter Wen <wnwen@chromium.org>
Reviewed-by: Sky Malice <skym@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#970697}
2022-02-14 17:58:54 +00:00
bce81715d4 Docs: update java_cpp_enum markdown doc
No change to logic. This updates the doc for java_cpp_enum:

* Explains how to correctly include
  //third_party/androidx:androidx_annotation_annotation_java in the
  dependencies
* Updates the doc to use androidx.annotation.IntDef instead of the
  legacy android.support package name
* Consolidates two steps for easier copy-pasting and consistency with
  the docs for java_cpp_features and java_cpp_switches
* Adds some troubleshooting steps in case the reader hits build errors

Test: I followed these steps to add a new java_cpp_enum rule
Test: review content: upload to gerrit > open file > click "gitiles"
Change-Id: Ib2de0d5be6a4b04a9efc101d8a3b52ee5ffaa471
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3025844
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#901323}
2021-07-14 02:14:15 +00:00
ac07b26220 Android: add java_cpp_features GN rule
This adds the java_cpp_features GN rule to autogenerate Java String
constants representing C++ features. This refactors parts of
java_cpp_strings so java_cpp_features can share it.

This aims to address the most common syntaxes for declaring C++
features (string literal names, "brace" and "equals brace"
initialization, with & without the "base::" namespace).

Design: http://go/autogen-java-features
Bug: 1060097
Fixed: 1091031
Test: vpython build/android/gpy/java_cpp_strings_tests.py
Test: vpython build/android/gpy/java_cpp_features_tests.py
Test: tools/md_browser/md_browser.py docs/android_accessing_cpp_features_in_java.md
Change-Id: I5311f72f8837c122186148cf183f4219087df96a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412840
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Peter Wen <wnwen@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812889}
2020-10-01 20:20:14 +00:00
93c5915741 Docs: consistent fenced code blocks
No change to logic, only docs. This is a mechanical docs change which
should not impact content (but will improve readability).

This edits some Android docs to use fenced code blocks more
consistently:

 * Prefer fenced code blocks over indented code blocks
 * Fix indentation issues (see coverage.md)
 * Specify a language for syntax highlighting where it makes sense
   (particularly, use the "gn" language where it was omitted)

R=agrieve@chromium.org

Bug: 918221
Test: Upload to gerrit > open file > click "gitiles"
Change-Id: I2a4aa292d3bd1cf67bd0a7bcfb0cb01f7b8ede98
Reviewed-on: https://chromium-review.googlesource.com/c/1451357
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628981}
2019-02-05 01:25:08 +00:00
dgn
2b5c5e8270 Cleanup definition of ActivityState and ApplicationStatus warnings
Removed the redundant ActivityStateEnum intdef definition and resolved
lint warnings in the ActivityState and ApplicationStatus classes.

Also updated the c++ enum conversion doc about the new IntDef
declaration style that was added in
https://crrev.com/14f477472e0e8612c98763b68e9a51bcae954c24

BUG=707186

Review-Url: https://codereview.chromium.org/2877743002
Cr-Commit-Position: refs/heads/master@{#471432}
2017-05-12 20:33:39 +00:00
c0dc6f499d Fix spelling mistakes in //docs.
This includes spelling mistakes like:

accomodate->accommodate
ommited->omitted
unuseable->unusable
dependant->dependent
enviroment->environment
preceed->precede
occurrance->occurrence
occurrances->occurrences
intergrated->integrated
altough->although
appriopriate->appropriate
corresponing->corresponding
dependecies->dependencies
leniant->lenient
overriden->overridden
persisten->persistent
specifyinhg->specifying

As well as capitalization changes like:

javascript->JavaScript
Webkit->WebKit
linux->Linux

A couple other minor things:

the the -> the
trybot -> try bot
etc.

Review-Url: https://codereview.chromium.org/2551513002
Cr-Commit-Position: refs/heads/master@{#436046}
2016-12-02 22:16:53 +00:00
c0b135ff0d Add public doc for accessing C++ enums in Java.
BUG=570878

Review-Url: https://codereview.chromium.org/2507863003
Cr-Commit-Position: refs/heads/master@{#432885}
2016-11-17 16:08:05 +00:00