web_message_host.h 796 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_JS_INJECTION_BROWSER_WEB_MESSAGE_HOST_H_
  5. #define COMPONENTS_JS_INJECTION_BROWSER_WEB_MESSAGE_HOST_H_
  6. #include <memory>
  7. namespace js_injection {
  8. struct WebMessage;
  9. // Represents the browser side of a WebMessage channel.
  10. class WebMessageHost {
  11. public:
  12. virtual ~WebMessageHost() = default;
  13. virtual void OnPostMessage(std::unique_ptr<WebMessage> message) = 0;
  14. // Called when the value of associated RenderFrameHost's
  15. // IsInBackForwardCache() changes.
  16. virtual void OnBackForwardCacheStateChanged() {}
  17. };
  18. } // namespace js_injection
  19. #endif // COMPONENTS_JS_INJECTION_BROWSER_WEB_MESSAGE_HOST_H_