2020-10-28 00:28:43 +03:00
|
|
|
// Copyright (c) 2020 Microsoft, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 10:34:31 +03:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_EXTENDED_WEB_CONTENTS_OBSERVER_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_EXTENDED_WEB_CONTENTS_OBSERVER_H_
|
2020-10-28 00:28:43 +03:00
|
|
|
|
2021-06-01 04:34:44 +03:00
|
|
|
#include <string>
|
2020-10-28 00:28:43 +03:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "base/observer_list.h"
|
|
|
|
#include "electron/shell/common/api/api.mojom.h"
|
|
|
|
#include "ui/gfx/geometry/rect.h"
|
|
|
|
|
|
|
|
namespace electron {
|
|
|
|
|
|
|
|
// Certain events are only in WebContentsDelegate, so we provide our own
|
|
|
|
// Observer to dispatch those events.
|
|
|
|
class ExtendedWebContentsObserver : public base::CheckedObserver {
|
|
|
|
public:
|
|
|
|
virtual void OnDraggableRegionsUpdated(
|
|
|
|
const std::vector<mojom::DraggableRegionPtr>& regions) {}
|
|
|
|
virtual void OnSetContentBounds(const gfx::Rect& rect) {}
|
|
|
|
virtual void OnActivateContents() {}
|
2021-03-16 19:18:45 +03:00
|
|
|
virtual void OnPageTitleUpdated(const std::u16string& title,
|
2020-10-28 00:28:43 +03:00
|
|
|
bool explicit_set) {}
|
2020-11-10 00:54:04 +03:00
|
|
|
virtual void OnDevToolsResized() {}
|
2020-10-28 00:28:43 +03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
~ExtendedWebContentsObserver() override {}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace electron
|
|
|
|
|
2021-11-22 10:34:31 +03:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_EXTENDED_WEB_CONTENTS_OBSERVER_H_
|