child_web_contents_tracker.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (c) 2017 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef SHELL_BROWSER_CHILD_WEB_CONTENTS_TRACKER_H_
  5. #define SHELL_BROWSER_CHILD_WEB_CONTENTS_TRACKER_H_
  6. #include <string>
  7. #include "content/public/browser/web_contents_user_data.h"
  8. namespace electron {
  9. // ChildWebContentsTracker tracks child WebContents
  10. // created by native `window.open()`
  11. struct ChildWebContentsTracker
  12. : public content::WebContentsUserData<ChildWebContentsTracker> {
  13. ~ChildWebContentsTracker() override;
  14. GURL url;
  15. std::string frame_name;
  16. content::Referrer referrer;
  17. std::string raw_features;
  18. scoped_refptr<network::ResourceRequestBody> body;
  19. private:
  20. explicit ChildWebContentsTracker(content::WebContents* web_contents);
  21. friend class content::WebContentsUserData<ChildWebContentsTracker>;
  22. WEB_CONTENTS_USER_DATA_KEY_DECL();
  23. DISALLOW_COPY_AND_ASSIGN(ChildWebContentsTracker);
  24. };
  25. } // namespace electron
  26. #endif // SHELL_BROWSER_CHILD_WEB_CONTENTS_TRACKER_H_