From c61e6f3f170197851ba07f595b54ef60127e9275 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 1 Feb 2016 21:08:52 +0800 Subject: [PATCH] Remove DefaultWebContentsDelegate --- .../browser/default_web_contents_delegate.cc | 28 ----------------- .../browser/default_web_contents_delegate.h | 31 ------------------- .../default_web_contents_delegate_mac.mm | 15 --------- brightray/filenames.gypi | 3 -- 4 files changed, 77 deletions(-) delete mode 100644 brightray/browser/default_web_contents_delegate.cc delete mode 100644 brightray/browser/default_web_contents_delegate.h delete mode 100644 brightray/browser/default_web_contents_delegate_mac.mm diff --git a/brightray/browser/default_web_contents_delegate.cc b/brightray/browser/default_web_contents_delegate.cc deleted file mode 100644 index 4c7051ba182a..000000000000 --- a/brightray/browser/default_web_contents_delegate.cc +++ /dev/null @@ -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 diff --git a/brightray/browser/default_web_contents_delegate.h b/brightray/browser/default_web_contents_delegate.h deleted file mode 100644 index 2e1ce681a7cd..000000000000 --- a/brightray/browser/default_web_contents_delegate.h +++ /dev/null @@ -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 diff --git a/brightray/browser/default_web_contents_delegate_mac.mm b/brightray/browser/default_web_contents_delegate_mac.mm deleted file mode 100644 index 78760614cbf0..000000000000 --- a/brightray/browser/default_web_contents_delegate_mac.mm +++ /dev/null @@ -1,15 +0,0 @@ -#import "browser/default_web_contents_delegate.h" - -#import "content/public/browser/native_web_keyboard_event.h" -#import - -namespace brightray { - -void DefaultWebContentsDelegate::HandleKeyboardEvent(content::WebContents*, const content::NativeWebKeyboardEvent& event) { - if (event.skip_in_browser) - return; - - [[NSApp mainMenu] performKeyEquivalent:event.os_event]; -} - -} \ No newline at end of file diff --git a/brightray/filenames.gypi b/brightray/filenames.gypi index 26c02679c052..c61af39748b8 100644 --- a/brightray/filenames.gypi +++ b/brightray/filenames.gypi @@ -9,9 +9,6 @@ 'browser/browser_main_parts.cc', 'browser/browser_main_parts.h', '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.h', 'browser/devtools_embedder_message_dispatcher.cc',