[proto_library] move action to public_deps

This allows other rules to depend on the outputs of the action.
An example of why this is useful:
https://fuchsia-review.googlesource.com/c/fuchsia/+/442058

Bug: 61402
Change-Id: I6e0e4141fb96b31b90a072425ca9cb8823303247
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/protobuf/+/441768
Reviewed-by: Zach Bush <zmbush@google.com>
diff --git a/proto_library.gni b/proto_library.gni
index 1ddf7dd..29ef1b3 100644
--- a/proto_library.gni
+++ b/proto_library.gni
@@ -344,6 +344,7 @@
     forward_variables_from(invoker,
                            [
                              "defines",
+                             "deps",
                              "testonly",
                              "visibility",
                            ])
@@ -361,6 +362,7 @@
 
     configs += [ "//third_party/protobuf:protobuf_warnings" ]
     public_configs = [ "//third_party/protobuf:using_proto" ]
+    public_deps = [ ":${action_name}" ]
 
     if (generate_cc || generate_with_plugin) {
       # If using built-in cc generator, the resulting headers reference headers
@@ -369,19 +371,11 @@
       if (generate_cc) {
         if (defined(invoker.use_protobuf_full) &&
             invoker.use_protobuf_full == true) {
-          public_deps = [ "//third_party/protobuf:protobuf_full" ]
+          public_deps += [ "//third_party/protobuf:protobuf_full" ]
         } else {
-          public_deps = [ "//third_party/protobuf:protobuf_lite" ]
+          public_deps += [ "//third_party/protobuf:protobuf_lite" ]
         }
       }
     }
-
-    deps = [ ":$action_name" ]
-
-    # This will link any libraries in the deps (the use of invoker.deps in the
-    # action won't link it).
-    if (defined(invoker.deps)) {
-      deps += invoker.deps
-    }
   }
 }