2013-03-14 17:48:17 +00:00
|
|
|
#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 {
|
|
|
|
|
2013-11-17 23:18:22 +00:00
|
|
|
// This class provides some sane default behaviors to any content::WebContents
|
|
|
|
// instance (e.g., keyboard shortcut handling on Mac).
|
2013-03-14 17:48:17 +00:00
|
|
|
class DefaultWebContentsDelegate : public content::WebContentsDelegate {
|
2013-11-17 23:18:22 +00:00
|
|
|
public:
|
2013-03-14 17:48:17 +00:00
|
|
|
DefaultWebContentsDelegate();
|
|
|
|
~DefaultWebContentsDelegate();
|
|
|
|
|
2013-11-17 23:18:22 +00:00
|
|
|
protected:
|
2015-01-23 23:12:24 +00:00
|
|
|
bool CheckMediaAccessPermission(content::WebContents* web_contents,
|
|
|
|
const GURL& security_origin,
|
|
|
|
content::MediaStreamType type) override;
|
|
|
|
void RequestMediaAccessPermission(
|
2013-11-17 23:18:22 +00:00
|
|
|
content::WebContents*,
|
|
|
|
const content::MediaStreamRequest&,
|
2014-10-23 03:10:39 +00:00
|
|
|
const content::MediaResponseCallback&) override;
|
2013-05-22 20:08:40 +00:00
|
|
|
#if defined(OS_MACOSX)
|
2015-01-23 23:12:24 +00:00
|
|
|
void HandleKeyboardEvent(
|
2014-10-23 03:10:39 +00:00
|
|
|
content::WebContents*, const content::NativeWebKeyboardEvent&) override;
|
2013-05-22 20:08:40 +00:00
|
|
|
#endif
|
2013-03-14 17:48:17 +00:00
|
|
|
};
|
|
|
|
|
2013-11-17 23:18:22 +00:00
|
|
|
} // namespace brightray
|
2013-03-14 17:48:17 +00:00
|
|
|
|
|
|
|
#endif
|