Remove DefaultWebContentsDelegate
This commit is contained in:
parent
7cfc9fad83
commit
c61e6f3f17
4 changed files with 0 additions and 77 deletions
|
@ -1,28 +0,0 @@
|
||||||
#include "browser/default_web_contents_delegate.h"
|
|
||||||
|
|
||||||
#include "browser/media/media_stream_devices_controller.h"
|
|
||||||
|
|
||||||
namespace brightray {
|
|
||||||
|
|
||||||
DefaultWebContentsDelegate::DefaultWebContentsDelegate() {
|
|
||||||
}
|
|
||||||
|
|
||||||
DefaultWebContentsDelegate::~DefaultWebContentsDelegate() {
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DefaultWebContentsDelegate::CheckMediaAccessPermission(
|
|
||||||
content::WebContents* web_contents,
|
|
||||||
const GURL& security_origin,
|
|
||||||
content::MediaStreamType type) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DefaultWebContentsDelegate::RequestMediaAccessPermission(
|
|
||||||
content::WebContents*,
|
|
||||||
const content::MediaStreamRequest& request,
|
|
||||||
const content::MediaResponseCallback& callback) {
|
|
||||||
MediaStreamDevicesController controller(request, callback);
|
|
||||||
controller.TakeAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace brightray
|
|
|
@ -1,31 +0,0 @@
|
||||||
#ifndef BRIGHTRAY_BROWSER_DEFAULT_WEB_CONTENTS_DELEGATE_H_
|
|
||||||
#define BRIGHTRAY_BROWSER_DEFAULT_WEB_CONTENTS_DELEGATE_H_
|
|
||||||
|
|
||||||
#include "content/public/browser/web_contents_delegate.h"
|
|
||||||
|
|
||||||
namespace brightray {
|
|
||||||
|
|
||||||
// This class provides some sane default behaviors to any content::WebContents
|
|
||||||
// instance (e.g., keyboard shortcut handling on Mac).
|
|
||||||
class DefaultWebContentsDelegate : public content::WebContentsDelegate {
|
|
||||||
public:
|
|
||||||
DefaultWebContentsDelegate();
|
|
||||||
~DefaultWebContentsDelegate();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool CheckMediaAccessPermission(content::WebContents* web_contents,
|
|
||||||
const GURL& security_origin,
|
|
||||||
content::MediaStreamType type) override;
|
|
||||||
void RequestMediaAccessPermission(
|
|
||||||
content::WebContents*,
|
|
||||||
const content::MediaStreamRequest&,
|
|
||||||
const content::MediaResponseCallback&) override;
|
|
||||||
#if defined(OS_MACOSX)
|
|
||||||
void HandleKeyboardEvent(
|
|
||||||
content::WebContents*, const content::NativeWebKeyboardEvent&) override;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace brightray
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,15 +0,0 @@
|
||||||
#import "browser/default_web_contents_delegate.h"
|
|
||||||
|
|
||||||
#import "content/public/browser/native_web_keyboard_event.h"
|
|
||||||
#import <AppKit/AppKit.h>
|
|
||||||
|
|
||||||
namespace brightray {
|
|
||||||
|
|
||||||
void DefaultWebContentsDelegate::HandleKeyboardEvent(content::WebContents*, const content::NativeWebKeyboardEvent& event) {
|
|
||||||
if (event.skip_in_browser)
|
|
||||||
return;
|
|
||||||
|
|
||||||
[[NSApp mainMenu] performKeyEquivalent:event.os_event];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -9,9 +9,6 @@
|
||||||
'browser/browser_main_parts.cc',
|
'browser/browser_main_parts.cc',
|
||||||
'browser/browser_main_parts.h',
|
'browser/browser_main_parts.h',
|
||||||
'browser/browser_main_parts_mac.mm',
|
'browser/browser_main_parts_mac.mm',
|
||||||
'browser/default_web_contents_delegate.cc',
|
|
||||||
'browser/default_web_contents_delegate.h',
|
|
||||||
'browser/default_web_contents_delegate_mac.mm',
|
|
||||||
'browser/devtools_contents_resizing_strategy.cc',
|
'browser/devtools_contents_resizing_strategy.cc',
|
||||||
'browser/devtools_contents_resizing_strategy.h',
|
'browser/devtools_contents_resizing_strategy.h',
|
||||||
'browser/devtools_embedder_message_dispatcher.cc',
|
'browser/devtools_embedder_message_dispatcher.cc',
|
||||||
|
|
Loading…
Reference in a new issue