atom_api_web_contents_osr.cc 832 B

123456789101112131415161718192021222324252627
  1. // Copyright (c) 2018 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #include "atom/browser/api/atom_api_web_contents.h"
  5. #include "atom/browser/osr/osr_web_contents_view.h"
  6. #include "content/browser/web_contents/web_contents_impl.h"
  7. // Including both web_contents_impl.h and node.h would introduce a error, we
  8. // have to isolate the usage of WebContentsImpl into a clean file to fix it:
  9. // error C2371: 'ssize_t': redefinition; different basic types
  10. namespace atom {
  11. namespace api {
  12. OffScreenWebContentsView* WebContents::GetOffScreenWebContentsView() const {
  13. const auto* impl =
  14. static_cast<const content::WebContentsImpl*>(web_contents());
  15. return static_cast<OffScreenWebContentsView*>(impl->GetView());
  16. }
  17. } // namespace api
  18. } // namespace atom