fix: draggable regions exclusively on BrowserViews (#26145)

This commit is contained in:
Shelley Vohr 2020-10-27 14:28:43 -07:00 committed by GitHub
parent 760c4aeb3e
commit 7cdc42f43a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 139 additions and 68 deletions

View file

@ -0,0 +1,35 @@
// Copyright (c) 2020 Microsoft, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_EXTENDED_WEB_CONTENTS_OBSERVER_H_
#define SHELL_BROWSER_EXTENDED_WEB_CONTENTS_OBSERVER_H_
#include <vector>
#include "base/observer_list.h"
#include "base/strings/string16.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 OnCloseContents() {}
virtual void OnDraggableRegionsUpdated(
const std::vector<mojom::DraggableRegionPtr>& regions) {}
virtual void OnSetContentBounds(const gfx::Rect& rect) {}
virtual void OnActivateContents() {}
virtual void OnPageTitleUpdated(const base::string16& title,
bool explicit_set) {}
protected:
~ExtendedWebContentsObserver() override {}
};
} // namespace electron
#endif // SHELL_BROWSER_EXTENDED_WEB_CONTENTS_OBSERVER_H_