} // namespace
WebContents::WebContents(content::WebContents* web_contents)
- : content::WebContentsObserver(web_contents),
+ : CommonWebContentsDelegate(false),
+ content::WebContentsObserver(web_contents),
guest_instance_id_(-1),
guest_opaque_(true),
guest_host_(nullptr),
}
WebContents::WebContents(const mate::Dictionary& options)
- : guest_instance_id_(-1),
+ : CommonWebContentsDelegate(true),
+ guest_instance_id_(-1),
guest_opaque_(true),
guest_host_(nullptr),
auto_size_enabled_(false),
#include <vector>
#include "atom/browser/api/event_emitter.h"
-#include "brightray/browser/default_web_contents_delegate.h"
+#include "atom/browser/common_web_contents_delegate.h"
#include "content/public/browser/browser_plugin_guest_delegate.h"
#include "content/public/common/favicon_url.h"
#include "content/public/browser/web_contents_delegate.h"
class WebContents : public mate::EventEmitter,
public content::BrowserPluginGuestDelegate,
- public brightray::DefaultWebContentsDelegate,
+ public CommonWebContentsDelegate,
public content::WebContentsObserver,
public content::GpuDataManagerObserver {
public:
--- /dev/null
+// Copyright (c) 2015 GitHub, Inc.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#include "atom/browser/common_web_contents_delegate.h"
+
+namespace atom {
+
+CommonWebContentsDelegate::CommonWebContentsDelegate(bool is_guest)
+ : is_guest_(is_guest) {
+}
+
+CommonWebContentsDelegate::~CommonWebContentsDelegate() {
+}
+
+} // namespace atom
--- /dev/null
+// Copyright (c) 2015 GitHub, Inc.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#ifndef ATOM_BROWSER_COMMON_WEB_CONTENTS_DELEGATE_H_
+#define ATOM_BROWSER_COMMON_WEB_CONTENTS_DELEGATE_H_
+
+#include "brightray/browser/default_web_contents_delegate.h"
+
+namespace atom {
+
+class CommonWebContentsDelegate : public brightray::DefaultWebContentsDelegate {
+ public:
+ explicit CommonWebContentsDelegate(bool is_guest);
+ virtual ~CommonWebContentsDelegate();
+
+ bool is_guest() const { return is_guest_; };
+
+ private:
+ const bool is_guest_;
+
+ DISALLOW_COPY_AND_ASSIGN(CommonWebContentsDelegate);
+};
+
+} // namespace atom
+
+#endif // ATOM_BROWSER_COMMON_WEB_CONTENTS_DELEGATE_H_
NativeWindow::NativeWindow(content::WebContents* web_contents,
const mate::Dictionary& options)
- : content::WebContentsObserver(web_contents),
+ : CommonWebContentsDelegate(false),
+ content::WebContentsObserver(web_contents),
has_frame_(true),
transparent_(false),
enable_larger_than_screen_(false),
#include <string>
#include <vector>
+#include "atom/browser/common_web_contents_delegate.h"
#include "atom/browser/native_window_observer.h"
#include "atom/browser/ui/accelerator_util.h"
#include "base/cancelable_callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
-#include "brightray/browser/default_web_contents_delegate.h"
#include "brightray/browser/inspectable_web_contents_delegate.h"
#include "brightray/browser/inspectable_web_contents_impl.h"
#include "content/public/browser/notification_registrar.h"
struct DraggableRegion;
class WebDialogHelper;
-class NativeWindow : public brightray::DefaultWebContentsDelegate,
+class NativeWindow : public CommonWebContentsDelegate,
public brightray::InspectableWebContentsDelegate,
public content::WebContentsObserver,
public content::NotificationObserver {
'atom/browser/browser_mac.mm',
'atom/browser/browser_win.cc',
'atom/browser/browser_observer.h',
+ 'atom/browser/common_web_contents_delegate.cc',
+ 'atom/browser/common_web_contents_delegate.h',
'atom/browser/javascript_environment.cc',
'atom/browser/javascript_environment.h',
'atom/browser/mac/atom_application.h',