Commit 677aac8f authored by Nick Diego Yamane's avatar Nick Diego Yamane Committed by Commit Bot

Migrate platform_window/handlers to component export macro

Also export WmMoveResizeHandler and do a few more minor cleanups.

R=sky@chromium.org

Bug: None
Change-Id: Ic627348b14d624641bf0adf6b30732e17f13b8f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2348692
Auto-Submit: Nick Yamane <nickdiego@igalia.com>
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797285}
parent 86360297
......@@ -14,10 +14,9 @@ component("handlers") {
"wm_move_loop_handler.h",
"wm_move_resize_handler.cc",
"wm_move_resize_handler.h",
"wm_platform_export.h",
]
defines = [ "PLATFORM_WINDOW_HANDLER_IMPLEMENTATION" ]
defines = [ "IS_HANDLERS_IMPL" ]
deps = [
"//ui/base",
......
......@@ -5,17 +5,19 @@
#ifndef UI_PLATFORM_WINDOW_HANDLERS_WM_DRAG_HANDLER_H_
#define UI_PLATFORM_WINDOW_HANDLERS_WM_DRAG_HANDLER_H_
#include "base/bind.h"
#include "base/component_export.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/platform_window/handlers/wm_platform_export.h"
namespace gfx {
class Point;
}
namespace ui {
class PlatformWindow;
class OSExchangeData;
class WM_PLATFORM_EXPORT WmDragHandler {
class COMPONENT_EXPORT(HANDLERS) WmDragHandler {
public:
// During the drag operation, the handler may send updates
class Delegate {
......@@ -57,10 +59,11 @@ class WM_PLATFORM_EXPORT WmDragHandler {
virtual void CancelDrag() = 0;
};
WM_PLATFORM_EXPORT void SetWmDragHandler(PlatformWindow* platform_window,
WmDragHandler* drag_handler);
WM_PLATFORM_EXPORT WmDragHandler* GetWmDragHandler(
const PlatformWindow& platform_window);
COMPONENT_EXPORT(HANDLERS)
void SetWmDragHandler(PlatformWindow* platform_window,
WmDragHandler* drag_handler);
COMPONENT_EXPORT(HANDLERS)
WmDragHandler* GetWmDragHandler(const PlatformWindow& platform_window);
} // namespace ui
......
......@@ -7,8 +7,7 @@
#include <memory>
#include "ui/gfx/native_widget_types.h"
#include "ui/platform_window/handlers/wm_platform_export.h"
#include "base/component_export.h"
namespace gfx {
class PointF;
......@@ -18,7 +17,7 @@ namespace ui {
class PlatformWindow;
class OSExchangeData;
class WM_PLATFORM_EXPORT WmDropHandler {
class COMPONENT_EXPORT(HANDLERS) WmDropHandler {
public:
// Notifies that drag has entered the window.
// |point| is in the coordinate space of the PlatformWindow.
......@@ -43,7 +42,7 @@ class WM_PLATFORM_EXPORT WmDropHandler {
// of the drop is the location of the latest DragEnter/DragMotion. If
// OSExchangeData is provided on OnDragEnter, the |data| should be same as it.
// |modifiers| contains bitmask of ui::EventFlags that accompany the event.
virtual void OnDragDrop(std::unique_ptr<ui::OSExchangeData> data,
virtual void OnDragDrop(std::unique_ptr<OSExchangeData> data,
int modifiers) = 0;
// Notifies that dragging is left. Must be called before
......@@ -51,13 +50,14 @@ class WM_PLATFORM_EXPORT WmDropHandler {
virtual void OnDragLeave() = 0;
protected:
virtual ~WmDropHandler() {}
virtual ~WmDropHandler() = default;
};
WM_PLATFORM_EXPORT void SetWmDropHandler(PlatformWindow* platform_window,
WmDropHandler* drop_handler);
WM_PLATFORM_EXPORT WmDropHandler* GetWmDropHandler(
const PlatformWindow& platform_window);
COMPONENT_EXPORT(HANDLERS)
void SetWmDropHandler(PlatformWindow* platform_window,
WmDropHandler* drop_handler);
COMPONENT_EXPORT(HANDLERS)
WmDropHandler* GetWmDropHandler(const PlatformWindow& platform_window);
} // namespace ui
......
......@@ -5,7 +5,7 @@
#ifndef UI_PLATFORM_WINDOW_HANDLERS_WM_MOVE_LOOP_HANDLER_H_
#define UI_PLATFORM_WINDOW_HANDLERS_WM_MOVE_LOOP_HANDLER_H_
#include "ui/platform_window/handlers/wm_platform_export.h"
#include "base/component_export.h"
namespace gfx {
class Vector2d;
......@@ -16,7 +16,7 @@ namespace ui {
class PlatformWindow;
// Handler that starts interactive move loop for the PlatformWindow.
class WM_PLATFORM_EXPORT WmMoveLoopHandler {
class COMPONENT_EXPORT(HANDLERS) WmMoveLoopHandler {
public:
// Starts a move loop for tab drag controller. Returns true on success or
// false on fail/cancel.
......@@ -29,10 +29,11 @@ class WM_PLATFORM_EXPORT WmMoveLoopHandler {
virtual ~WmMoveLoopHandler() {}
};
WM_PLATFORM_EXPORT void SetWmMoveLoopHandler(PlatformWindow* platform_window,
WmMoveLoopHandler* drag_handler);
WM_PLATFORM_EXPORT WmMoveLoopHandler* GetWmMoveLoopHandler(
const PlatformWindow& platform_window);
COMPONENT_EXPORT(HANDLERS)
void SetWmMoveLoopHandler(PlatformWindow* platform_window,
WmMoveLoopHandler* drag_handler);
COMPONENT_EXPORT(HANDLERS)
WmMoveLoopHandler* GetWmMoveLoopHandler(const PlatformWindow& platform_window);
} // namespace ui
......
......@@ -5,7 +5,7 @@
#ifndef UI_PLATFORM_WINDOW_HANDLERS_WM_MOVE_RESIZE_HANDLER_H_
#define UI_PLATFORM_WINDOW_HANDLERS_WM_MOVE_RESIZE_HANDLER_H_
#include "ui/platform_window/handlers/wm_platform_export.h"
#include "base/component_export.h"
namespace gfx {
class Point;
......@@ -15,7 +15,7 @@ namespace ui {
class PlatformWindow;
class WmMoveResizeHandler {
class COMPONENT_EXPORT(HANDLERS) WmMoveResizeHandler {
public:
// A system window manager starts interactive drag or resize of a window based
// on the |hittest| value. The |hittest| value identifies in which direction
......@@ -52,10 +52,11 @@ class WmMoveResizeHandler {
virtual ~WmMoveResizeHandler() {}
};
WM_PLATFORM_EXPORT void SetWmMoveResizeHandler(
PlatformWindow* platform_window,
WmMoveResizeHandler* move_resize_handler);
WM_PLATFORM_EXPORT WmMoveResizeHandler* GetWmMoveResizeHandler(
COMPONENT_EXPORT(HANDLERS)
void SetWmMoveResizeHandler(PlatformWindow* platform_window,
WmMoveResizeHandler* move_resize_handler);
COMPONENT_EXPORT(HANDLERS)
WmMoveResizeHandler* GetWmMoveResizeHandler(
const PlatformWindow& platform_window);
} // namespace ui
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_PLATFORM_WINDOW_HANDLERS_WM_PLATFORM_EXPORT_H_
#define UI_PLATFORM_WINDOW_HANDLERS_WM_PLATFORM_EXPORT_H_
// Defines WM_PLATFORM_EXPORT so that functionality implemented by the
// wm_platform module can be exported to consumers.
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(PLATFORM_WINDOW_HANDLER_IMPLEMENTATION)
#define WM_PLATFORM_EXPORT __declspec(dllexport)
#else
#define WM_PLATFORM_EXPORT __declspec(dllimport)
#endif // defined(WM_PLATFORM_IMPLEMENTATION)
#else // defined(WIN32)
#if defined(PLATFORM_WINDOW_HANDLER_IMPLEMENTATION)
#define WM_PLATFORM_EXPORT __attribute__((visibility("default")))
#else
#define WM_PLATFORM_EXPORT
#endif
#endif
#else // defined(COMPONENT_BUILD)
#define WM_PLATFORM_EXPORT
#endif
#endif // UI_PLATFORM_WINDOW_HANDLERS_WM_PLATFORM_EXPORT_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment