Allow the dep cycle chrome/browser/extensions <-> api_registration

The generated api_registration files use a lot of headers
in chrome/browser/extensions, creating a dependency cycle.
I see no obvious way to break the cycle so this just makes
it official.

There were also a couple of files in chrome/browser/accessibility
which were used from api registration, creating an unpleasant
dependency. That was fixed by putting those files in extensions
instead of in chrome/browser.

The missing dependencies triggered a lot of gn errors with a gn fixed
to look at generated files (gn:57).

The list is about 60 reports like:

ERROR at //out/Default/gen/chrome/browser/extensions/api/ Include not allowed.
It is not in any dependency of
The include file is in the target(s):
which should somehow be reachable.

Bug: 655123
Change-Id: Ifc7809de17c9a426d2a6abdb41ecc42996b0d01f
Reviewed-by: Devlin <>
Reviewed-by: Dominic Mazzoni <>
Commit-Queue: Daniel Bratell <>
Cr-Commit-Position: refs/heads/master@{#644715}
diff --git a/chrome/browser/ b/chrome/browser/
index 3fc465c..43db0b7 100644
--- a/chrome/browser/
+++ b/chrome/browser/
@@ -4067,8 +4067,6 @@
   if (enable_extensions) {
     sources += [
-      "accessibility/",
-      "accessibility/accessibility_extension_api.h",
diff --git a/chrome/browser/extensions/ b/chrome/browser/extensions/
index d950ff6..30f0127 100644
--- a/chrome/browser/extensions/
+++ b/chrome/browser/extensions/
@@ -18,6 +18,8 @@
   sources = [
     # TODO These references to files in //chrome/browser/ should either be
     # moved to the browser target or the files moved to this directory.
+    "../accessibility/",
+    "../accessibility/accessibility_extension_api.h",
@@ -752,6 +754,9 @@
   defines = []
   allow_circular_includes_from = [
+    # Lots of APIs use headers from the list above.
+    "//chrome/browser/extensions/api:api_registration",
     # TODO(loyso): Remove this circular dependency.