extended_web_contents_observer.h 980 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) 2020 Microsoft, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ELECTRON_SHELL_BROWSER_EXTENDED_WEB_CONTENTS_OBSERVER_H_
  5. #define ELECTRON_SHELL_BROWSER_EXTENDED_WEB_CONTENTS_OBSERVER_H_
  6. #include <string>
  7. #include "base/observer_list_types.h"
  8. namespace gfx {
  9. class Rect;
  10. }
  11. namespace electron {
  12. // Certain events are only in WebContentsDelegate, so we provide our own
  13. // Observer to dispatch those events.
  14. class ExtendedWebContentsObserver : public base::CheckedObserver {
  15. public:
  16. virtual void OnSetContentBounds(const gfx::Rect& rect) {}
  17. virtual void OnActivateContents() {}
  18. virtual void OnPageTitleUpdated(const std::u16string& title,
  19. bool explicit_set) {}
  20. virtual void OnDevToolsResized() {}
  21. protected:
  22. ~ExtendedWebContentsObserver() override {}
  23. };
  24. } // namespace electron
  25. #endif // ELECTRON_SHELL_BROWSER_EXTENDED_WEB_CONTENTS_OBSERVER_H_