Require !OS_MACOSX as well as TOOLKIT_VIEWS for views code

This commit is contained in:
Jeremy Apthorp 2018-05-10 13:52:17 -07:00
parent 1cc5492784
commit 87d0175c76
4 changed files with 9 additions and 9 deletions

View file

@ -637,7 +637,7 @@ void WebContents::MoveContents(content::WebContents* source,
void WebContents::CloseContents(content::WebContents* source) { void WebContents::CloseContents(content::WebContents* source) {
Emit("close"); Emit("close");
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
HideAutofillPopup(); HideAutofillPopup();
#endif #endif
if (managed_web_contents()) if (managed_web_contents())
@ -1071,7 +1071,7 @@ void WebContents::DevToolsClosed() {
Emit("devtools-closed"); Emit("devtools-closed");
} }
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
void WebContents::ShowAutofillPopup(content::RenderFrameHost* frame_host, void WebContents::ShowAutofillPopup(content::RenderFrameHost* frame_host,
const gfx::RectF& bounds, const gfx::RectF& bounds,
const std::vector<base::string16>& values, const std::vector<base::string16>& values,
@ -1106,7 +1106,7 @@ bool WebContents::OnMessageReceived(const IPC::Message& message,
FrameDispatchHelper::OnSetTemporaryZoomLevel) FrameDispatchHelper::OnSetTemporaryZoomLevel)
IPC_MESSAGE_FORWARD_DELAY_REPLY(AtomFrameHostMsg_GetZoomLevel, &helper, IPC_MESSAGE_FORWARD_DELAY_REPLY(AtomFrameHostMsg_GetZoomLevel, &helper,
FrameDispatchHelper::OnGetZoomLevel) FrameDispatchHelper::OnGetZoomLevel)
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(AtomAutofillFrameHostMsg_ShowPopup, ShowAutofillPopup) IPC_MESSAGE_HANDLER(AtomAutofillFrameHostMsg_ShowPopup, ShowAutofillPopup)
IPC_MESSAGE_HANDLER(AtomAutofillFrameHostMsg_HidePopup, HideAutofillPopup) IPC_MESSAGE_HANDLER(AtomAutofillFrameHostMsg_HidePopup, HideAutofillPopup)
#endif #endif

View file

@ -178,7 +178,7 @@ void CommonWebContentsDelegate::SetOwnerWindow(
auto relay = std::make_unique<NativeWindowRelay>(owner_window_); auto relay = std::make_unique<NativeWindowRelay>(owner_window_);
auto* relay_key = relay->key; auto* relay_key = relay->key;
if (owner_window) { if (owner_window) {
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
autofill_popup_.reset(new AutofillPopup()); autofill_popup_.reset(new AutofillPopup());
#endif #endif
web_contents->SetUserData(relay_key, std::move(relay)); web_contents->SetUserData(relay_key, std::move(relay));

View file

@ -15,7 +15,7 @@
#include "brightray/browser/inspectable_web_contents_view_delegate.h" #include "brightray/browser/inspectable_web_contents_view_delegate.h"
#include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_delegate.h"
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
#include "atom/browser/ui/autofill_popup.h" #include "atom/browser/ui/autofill_popup.h"
#endif #endif
@ -91,7 +91,7 @@ class CommonWebContentsDelegate
const content::NativeWebKeyboardEvent& event) override; const content::NativeWebKeyboardEvent& event) override;
// Autofill related events. // Autofill related events.
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
void ShowAutofillPopup(bool offscreen, void ShowAutofillPopup(bool offscreen,
content::RenderFrameHost* frame_host, content::RenderFrameHost* frame_host,
const gfx::RectF& bounds, const gfx::RectF& bounds,
@ -118,7 +118,7 @@ class CommonWebContentsDelegate
const std::string& query) override; const std::string& query) override;
// brightray::InspectableWebContentsViewDelegate: // brightray::InspectableWebContentsViewDelegate:
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
gfx::ImageSkia GetDevToolsWindowIcon() override; gfx::ImageSkia GetDevToolsWindowIcon() override;
#endif #endif
#if defined(USE_X11) #if defined(USE_X11)
@ -165,7 +165,7 @@ class CommonWebContentsDelegate
bool native_fullscreen_; bool native_fullscreen_;
// UI related helper classes. // UI related helper classes.
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
std::unique_ptr<AutofillPopup> autofill_popup_; std::unique_ptr<AutofillPopup> autofill_popup_;
#endif #endif
std::unique_ptr<WebDialogHelper> web_dialog_helper_; std::unique_ptr<WebDialogHelper> web_dialog_helper_;

View file

@ -27,7 +27,7 @@ class InspectableWebContentsView {
} }
InspectableWebContentsViewDelegate* GetDelegate() const { return delegate_; } InspectableWebContentsViewDelegate* GetDelegate() const { return delegate_; }
#if defined(TOOLKIT_VIEWS) #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
// Returns the container control, which has devtools view attached. // Returns the container control, which has devtools view attached.
virtual views::View* GetView() = 0; virtual views::View* GetView() = 0;