1

I'm developing new features for an old version of Google Chrome (71.0.3578.141).

In the file src/content/browser/devtools/protocol/page_handler.cc, I need to add the following includes:

src/content/browser/devtools/protocol/page_handler.cc:

#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"

When I execute gn check out/Default, the output is:

ERROR at //content/browser/devtools/protocol/page_handler.cc:8:11: Include not allowed.
#include "chrome/browser/ui/browser_list.h"
          ^-------------------------------
It is not in any dependency of
  //content/browser:browser
The include file is in the target(s):
  //chrome/browser/ui:ui
which should somehow be reachable.
___________________
ERROR at //content/browser/devtools/protocol/page_handler.cc:9:11: Include not allowed.
#include "chrome/browser/ui/browser.h"
          ^--------------------------
It is not in any dependency of
  //content/browser:browser
The include file is in the target(s):
  //chrome/browser/ui:ui
which should somehow be reachable.
___________________
ERROR at //content/browser/devtools/protocol/page_handler.cc:10:11: Include not allowed.
#include "chrome/browser/ui/browser_window.h"
          ^---------------------------------
It is not in any dependency of
  //content/browser:browser
The include file is in the target(s):
  //chrome/browser/ui:ui
which should somehow be reachable.

Sorry but I'm a newbie and I don't know how the GN (Ninja) tool works. I think that I have to modify some BUILD.gn files (or any other GN config files) but I don't know where to start. Please, can anyone help me? Thanks in advance!

LGCD
  • 11
  • 1
  • I can't speak to GN, but the point of Ninja build files are that they are human readable, but not really human writable. You should have a build system that will create the new build files for you, like cmake. – sweenish Sep 15 '21 at 11:12
  • You will have to add that file in the relevant `BUILD.gn` file. If it's header only then it might not be necessary, not sure though. You can refer to this page to get started with GN: https://gn.googlesource.com/gn/+/HEAD/docs/quick_start.md – Asesh Sep 15 '21 at 12:01
  • Thanks for the responses. I have also source files and I'm trying to add all files (headers and sources) to src/content/browser/BUILD.gn unsuccessfully. It seems to me that maybe I need to give public access to this files from the target //chrome/browser/ui:ui to allow to be included in the other target: //content/browser:browser. – LGCD Sep 15 '21 at 14:49

0 Answers0