diff options
Diffstat (limited to 'chromium/ui/base/win')
-rw-r--r-- | chromium/ui/base/win/accessibility_misc_utils.h | 4 | ||||
-rw-r--r-- | chromium/ui/base/win/event_creation_utils.cc | 37 | ||||
-rw-r--r-- | chromium/ui/base/win/event_creation_utils.h | 23 | ||||
-rw-r--r-- | chromium/ui/base/win/foreground_helper.h | 6 | ||||
-rw-r--r-- | chromium/ui/base/win/hidden_window.cc | 1 | ||||
-rw-r--r-- | chromium/ui/base/win/hidden_window.h | 4 | ||||
-rw-r--r-- | chromium/ui/base/win/hwnd_metrics.h | 4 | ||||
-rw-r--r-- | chromium/ui/base/win/hwnd_subclass.h | 6 | ||||
-rw-r--r-- | chromium/ui/base/win/internal_constants.h | 7 | ||||
-rw-r--r-- | chromium/ui/base/win/lock_state.h | 4 | ||||
-rw-r--r-- | chromium/ui/base/win/message_box_win.h | 11 | ||||
-rw-r--r-- | chromium/ui/base/win/mouse_wheel_util.h | 10 | ||||
-rw-r--r-- | chromium/ui/base/win/scoped_ole_initializer.h | 4 | ||||
-rw-r--r-- | chromium/ui/base/win/session_change_observer.h | 4 | ||||
-rw-r--r-- | chromium/ui/base/win/shell.h | 48 | ||||
-rw-r--r-- | chromium/ui/base/win/touch_input.h | 11 | ||||
-rw-r--r-- | chromium/ui/base/win/window_event_target.h | 4 |
17 files changed, 128 insertions, 60 deletions
diff --git a/chromium/ui/base/win/accessibility_misc_utils.h b/chromium/ui/base/win/accessibility_misc_utils.h index ec493a3cad2..98116875245 100644 --- a/chromium/ui/base/win/accessibility_misc_utils.h +++ b/chromium/ui/base/win/accessibility_misc_utils.h @@ -9,14 +9,14 @@ #include <UIAutomationCore.h> #include "base/compiler_specific.h" +#include "base/component_export.h" #include "base/strings/string16.h" -#include "ui/base/ui_base_export.h" namespace base { namespace win { // UIA Text provider implementation for edit controls. -class UI_BASE_EXPORT UIATextProvider +class COMPONENT_EXPORT(UI_BASE) UIATextProvider : public CComObjectRootEx<CComMultiThreadModel>, public ITextProvider { public: diff --git a/chromium/ui/base/win/event_creation_utils.cc b/chromium/ui/base/win/event_creation_utils.cc new file mode 100644 index 00000000000..29efc62b3cc --- /dev/null +++ b/chromium/ui/base/win/event_creation_utils.cc @@ -0,0 +1,37 @@ +// Copyright (c) 2020 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. + +#include "ui/base/win/event_creation_utils.h" + +#include <windows.h> +#include <winuser.h> + +#include <algorithm> + +#include "base/numerics/ranges.h" +#include "ui/gfx/geometry/point.h" + +namespace ui { + +bool SendMouseEvent(const gfx::Point& point, int flags) { + INPUT input = {INPUT_MOUSE}; + // Get the max screen coordinate for use in computing the normalized absolute + // coordinates required by SendInput. + const int max_x = ::GetSystemMetrics(SM_CXSCREEN) - 1; + const int max_y = ::GetSystemMetrics(SM_CYSCREEN) - 1; + int screen_x = base::ClampToRange(point.x(), 0, max_x); + int screen_y = base::ClampToRange(point.y(), 0, max_y); + + // Form the input data containing the normalized absolute coordinates. As of + // Windows 10 Fall Creators Update, moving to an absolute position of zero + // does not work. It seems that moving to 1,1 does, though. + input.mi.dx = + static_cast<LONG>(std::max(1.0, std::ceil(screen_x * (65535.0 / max_x)))); + input.mi.dy = + static_cast<LONG>(std::max(1.0, std::ceil(screen_y * (65535.0 / max_y)))); + input.mi.dwFlags = flags; + return ::SendInput(1, &input, sizeof(input)) == 1; +} + +} // namespace ui diff --git a/chromium/ui/base/win/event_creation_utils.h b/chromium/ui/base/win/event_creation_utils.h new file mode 100644 index 00000000000..cb893f240a2 --- /dev/null +++ b/chromium/ui/base/win/event_creation_utils.h @@ -0,0 +1,23 @@ +// Copyright (c) 2020 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_BASE_WIN_EVENT_CREATION_UTILS_H_ +#define UI_BASE_WIN_EVENT_CREATION_UTILS_H_ + +#include "base/component_export.h" + +namespace gfx { +class Point; +} // namespace gfx + +namespace ui { + +// Send a mouse event to Windows input queue using ::SendInput, to screen +// point |point|. Returns true if the mouse event was sent, false if not. +COMPONENT_EXPORT(UI_BASE) +bool SendMouseEvent(const gfx::Point& point, int flags); + +} // namespace ui + +#endif // UI_BASE_WIN_EVENT_CREATION_UTILS_H_ diff --git a/chromium/ui/base/win/foreground_helper.h b/chromium/ui/base/win/foreground_helper.h index 38dcdbab9f2..333b87531d9 100644 --- a/chromium/ui/base/win/foreground_helper.h +++ b/chromium/ui/base/win/foreground_helper.h @@ -5,9 +5,9 @@ #ifndef UI_BASE_WIN_FOREGROUND_HELPER_H_ #define UI_BASE_WIN_FOREGROUND_HELPER_H_ -#include "base/logging.h" +#include "base/component_export.h" #include "base/macros.h" -#include "ui/base/ui_base_export.h" +#include "base/notreached.h" #include "ui/gfx/win/window_impl.h" #include <windows.h> @@ -21,7 +21,7 @@ namespace ui { // to be capable of moving to the foreground. // // This is probably leveraging a windows bug. -class UI_BASE_EXPORT ForegroundHelper : public gfx::WindowImpl { +class COMPONENT_EXPORT(UI_BASE) ForegroundHelper : public gfx::WindowImpl { public: ForegroundHelper(); ~ForegroundHelper() override; diff --git a/chromium/ui/base/win/hidden_window.cc b/chromium/ui/base/win/hidden_window.cc index 3312dde6b26..accdea3bf6d 100644 --- a/chromium/ui/base/win/hidden_window.cc +++ b/chromium/ui/base/win/hidden_window.cc @@ -4,6 +4,7 @@ #include "ui/base/win/hidden_window.h" +#include "base/notreached.h" #include "ui/gfx/win/window_impl.h" namespace ui { diff --git a/chromium/ui/base/win/hidden_window.h b/chromium/ui/base/win/hidden_window.h index 6cc2fd0dd6d..8524f1dafe4 100644 --- a/chromium/ui/base/win/hidden_window.h +++ b/chromium/ui/base/win/hidden_window.h @@ -7,13 +7,13 @@ #include <windows.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { // Returns an HWND that can be used as a temporary parent. The returned HWND is // never destroyed. -UI_BASE_EXPORT HWND GetHiddenWindow(); +COMPONENT_EXPORT(UI_BASE) HWND GetHiddenWindow(); } // namespace ui diff --git a/chromium/ui/base/win/hwnd_metrics.h b/chromium/ui/base/win/hwnd_metrics.h index 22ec6f9c85e..bc171aaebb9 100644 --- a/chromium/ui/base/win/hwnd_metrics.h +++ b/chromium/ui/base/win/hwnd_metrics.h @@ -7,12 +7,12 @@ #include <windows.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { // The size, in pixels, of the non-client frame around a window on |monitor|. -UI_BASE_EXPORT int GetFrameThickness(HMONITOR monitor); +COMPONENT_EXPORT(UI_BASE) int GetFrameThickness(HMONITOR monitor); } // namespace ui diff --git a/chromium/ui/base/win/hwnd_subclass.h b/chromium/ui/base/win/hwnd_subclass.h index 56bced1b34d..6628f7b8d68 100644 --- a/chromium/ui/base/win/hwnd_subclass.h +++ b/chromium/ui/base/win/hwnd_subclass.h @@ -10,15 +10,15 @@ #include <memory> #include <vector> +#include "base/component_export.h" #include "base/macros.h" -#include "ui/base/ui_base_export.h" #include "ui/base/view_prop.h" namespace ui { // Classes implementing this interface get the opportunity to handle and consume // messages before they are sent to their target HWND. -class UI_BASE_EXPORT HWNDMessageFilter { +class COMPONENT_EXPORT(UI_BASE) HWNDMessageFilter { public: virtual ~HWNDMessageFilter(); @@ -39,7 +39,7 @@ class UI_BASE_EXPORT HWNDMessageFilter { // An object that instance-subclasses a window. If the window has already been // instance-subclassed, that subclassing is lost. -class UI_BASE_EXPORT HWNDSubclass { +class COMPONENT_EXPORT(UI_BASE) HWNDSubclass { public: ~HWNDSubclass(); diff --git a/chromium/ui/base/win/internal_constants.h b/chromium/ui/base/win/internal_constants.h index 65f025f397a..c34541f5cbb 100644 --- a/chromium/ui/base/win/internal_constants.h +++ b/chromium/ui/base/win/internal_constants.h @@ -5,18 +5,19 @@ #ifndef UI_BASE_WIN_INTERNAL_CONSTANTS_H_ #define UI_BASE_WIN_INTERNAL_CONSTANTS_H_ -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { // This window property if set on the window does not activate the window for a // touch based WM_MOUSEACTIVATE message. -UI_BASE_EXPORT extern const wchar_t kIgnoreTouchMouseActivateForWindow[]; +COMPONENT_EXPORT(UI_BASE) +extern const wchar_t kIgnoreTouchMouseActivateForWindow[]; // This property is put on an HWND so the compositor output knows to treat it // as transparent and draw to it using WS_EX_LAYERED (if using the software // compositor). -UI_BASE_EXPORT extern const wchar_t kWindowTranslucent[]; +COMPONENT_EXPORT(UI_BASE) extern const wchar_t kWindowTranslucent[]; } // namespace ui diff --git a/chromium/ui/base/win/lock_state.h b/chromium/ui/base/win/lock_state.h index 02a7a2d72df..c596b5a2e08 100644 --- a/chromium/ui/base/win/lock_state.h +++ b/chromium/ui/base/win/lock_state.h @@ -5,12 +5,12 @@ #ifndef UI_BASE_WIN_LOCK_STATE_H_ #define UI_BASE_WIN_LOCK_STATE_H_ -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { // Returns true if the screen is currently locked. -UI_BASE_EXPORT bool IsWorkstationLocked(); +COMPONENT_EXPORT(UI_BASE) bool IsWorkstationLocked(); } // namespace ui diff --git a/chromium/ui/base/win/message_box_win.h b/chromium/ui/base/win/message_box_win.h index f48bec3e4fa..f19bb39e6fa 100644 --- a/chromium/ui/base/win/message_box_win.h +++ b/chromium/ui/base/win/message_box_win.h @@ -7,8 +7,8 @@ #include <windows.h> +#include "base/component_export.h" #include "base/strings/string16.h" -#include "ui/base/ui_base_export.h" namespace ui { @@ -16,10 +16,11 @@ namespace ui { // MessageBox function allows us to control certain RTL locale flags so that // callers don't have to worry about adding these flags when running in a // right-to-left locale. -UI_BASE_EXPORT int MessageBox(HWND hwnd, - const base::string16& text, - const base::string16& caption, - UINT flags); +COMPONENT_EXPORT(UI_BASE) +int MessageBox(HWND hwnd, + const base::string16& text, + const base::string16& caption, + UINT flags); } // namespace ui diff --git a/chromium/ui/base/win/mouse_wheel_util.h b/chromium/ui/base/win/mouse_wheel_util.h index b9f5872b0c4..7dc76d2a1f8 100644 --- a/chromium/ui/base/win/mouse_wheel_util.h +++ b/chromium/ui/base/win/mouse_wheel_util.h @@ -7,7 +7,7 @@ #include <windows.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { @@ -17,7 +17,8 @@ class ViewProp; // We reroute the mouse wheel messages to such HWND when they are under the // mouse pointer (but are not the active window). Callers own the returned // object. -UI_BASE_EXPORT ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); +COMPONENT_EXPORT(UI_BASE) +ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); // Forwards mouse wheel messages to the window under it. // Windows sends mouse wheel messages to the currently active window. @@ -26,9 +27,8 @@ UI_BASE_EXPORT ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); // mouse wheel in order to scroll that window. This is arguably a better user // experience. The returns value says whether the mouse wheel message was // successfully redirected. -UI_BASE_EXPORT bool RerouteMouseWheel(HWND window, - WPARAM w_param, - LPARAM l_param); +COMPONENT_EXPORT(UI_BASE) +bool RerouteMouseWheel(HWND window, WPARAM w_param, LPARAM l_param); } // namespace ui diff --git a/chromium/ui/base/win/scoped_ole_initializer.h b/chromium/ui/base/win/scoped_ole_initializer.h index 28085f5f022..c82b1e1ddf7 100644 --- a/chromium/ui/base/win/scoped_ole_initializer.h +++ b/chromium/ui/base/win/scoped_ole_initializer.h @@ -5,14 +5,14 @@ #ifndef UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_ #define UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_ +#include "base/component_export.h" #include "base/macros.h" #include "base/threading/thread_checker.h" #include "base/win/windows_types.h" -#include "ui/base/ui_base_export.h" namespace ui { -class UI_BASE_EXPORT ScopedOleInitializer { +class COMPONENT_EXPORT(UI_BASE) ScopedOleInitializer { public: ScopedOleInitializer(); ~ScopedOleInitializer(); diff --git a/chromium/ui/base/win/session_change_observer.h b/chromium/ui/base/win/session_change_observer.h index b2b73f8a351..8ebb68d27d8 100644 --- a/chromium/ui/base/win/session_change_observer.h +++ b/chromium/ui/base/win/session_change_observer.h @@ -8,8 +8,8 @@ #include <windows.h> #include "base/callback.h" +#include "base/component_export.h" #include "base/macros.h" -#include "ui/base/ui_base_export.h" namespace ui { @@ -17,7 +17,7 @@ namespace ui { // managing the tricky business of observing a singleton object. Only // WTS_SESSION_LOCK and WTS_SESSION_UNLOCK events trigger the callback // because those are the only events existing observers handle. -class UI_BASE_EXPORT SessionChangeObserver { +class COMPONENT_EXPORT(UI_BASE) SessionChangeObserver { public: // WPARAM is the wparam passed to the OnWndProc when message is // WM_WTSSESSION_CHANGE. The bool indicates whether the session diff --git a/chromium/ui/base/win/shell.h b/chromium/ui/base/win/shell.h index 5a91276fe65..758c354bb09 100644 --- a/chromium/ui/base/win/shell.h +++ b/chromium/ui/base/win/shell.h @@ -7,8 +7,8 @@ #include <windows.h> +#include "base/component_export.h" #include "base/strings/string16.h" -#include "ui/base/ui_base_export.h" namespace base { class FilePath; @@ -21,7 +21,8 @@ namespace win { // |full_path| does not refer to a folder. // // Note: Must be called on a thread that allows blocking. -UI_BASE_EXPORT bool OpenFolderViaShell(const base::FilePath& full_path); +COMPONENT_EXPORT(UI_BASE) +bool OpenFolderViaShell(const base::FilePath& full_path); // Invokes the default verb on the file specified by |full_path| via the Windows // shell. Usually, the default verb is "open" unless specified otherwise for the @@ -32,53 +33,56 @@ UI_BASE_EXPORT bool OpenFolderViaShell(const base::FilePath& full_path); // |true| on success. // // Note: Must be called on a thread that allows blocking. -UI_BASE_EXPORT bool OpenFileViaShell(const base::FilePath& full_path); +COMPONENT_EXPORT(UI_BASE) +bool OpenFileViaShell(const base::FilePath& full_path); // Disables the ability of the specified window to be pinned to the taskbar or // the Start menu. This will remove "Pin this program to taskbar" from the // taskbar menu of the specified window. -UI_BASE_EXPORT bool PreventWindowFromPinning(HWND hwnd); +COMPONENT_EXPORT(UI_BASE) bool PreventWindowFromPinning(HWND hwnd); // Sets the application id, app icon, relaunch command and relaunch display name // for the given window. |app_icon_index| should be set to 0 if the app icon // file only has a single icon. -UI_BASE_EXPORT void SetAppDetailsForWindow( - const base::string16& app_id, - const base::FilePath& app_icon_path, - int app_icon_index, - const base::string16& relaunch_command, - const base::string16& relaunch_display_name, - HWND hwnd); +COMPONENT_EXPORT(UI_BASE) +void SetAppDetailsForWindow(const base::string16& app_id, + const base::FilePath& app_icon_path, + int app_icon_index, + const base::string16& relaunch_command, + const base::string16& relaunch_display_name, + HWND hwnd); // Sets the application id given as the Application Model ID for the window // specified. This method is used to insure that different web applications // do not group together on the Win7 task bar. -UI_BASE_EXPORT void SetAppIdForWindow(const base::string16& app_id, HWND hwnd); +COMPONENT_EXPORT(UI_BASE) +void SetAppIdForWindow(const base::string16& app_id, HWND hwnd); // Sets the application icon for the window specified. -UI_BASE_EXPORT void SetAppIconForWindow(const base::FilePath& app_icon_path, - int app_icon_index, - HWND hwnd); +COMPONENT_EXPORT(UI_BASE) +void SetAppIconForWindow(const base::FilePath& app_icon_path, + int app_icon_index, + HWND hwnd); // Sets the relaunch command and relaunch display name for the window specified. // Windows will use this information for grouping on the taskbar, and to create // a shortcut if the window is pinned to the taskbar. -UI_BASE_EXPORT void SetRelaunchDetailsForWindow( - const base::string16& relaunch_command, - const base::string16& display_name, - HWND hwnd); +COMPONENT_EXPORT(UI_BASE) +void SetRelaunchDetailsForWindow(const base::string16& relaunch_command, + const base::string16& display_name, + HWND hwnd); // Clears the Window Property Store on an HWND. -UI_BASE_EXPORT void ClearWindowPropertyStore(HWND hwnd); +COMPONENT_EXPORT(UI_BASE) void ClearWindowPropertyStore(HWND hwnd); // Returns true if dwm composition is available and turned on on the current // platform. // This method supports a command-line override for testing. -UI_BASE_EXPORT bool IsAeroGlassEnabled(); +COMPONENT_EXPORT(UI_BASE) bool IsAeroGlassEnabled(); // Returns true if dwm composition is available and turned on on the current // platform. -UI_BASE_EXPORT bool IsDwmCompositionEnabled(); +COMPONENT_EXPORT(UI_BASE) bool IsDwmCompositionEnabled(); } // namespace win } // namespace ui diff --git a/chromium/ui/base/win/touch_input.h b/chromium/ui/base/win/touch_input.h index f113ec5b463..83457080a39 100644 --- a/chromium/ui/base/win/touch_input.h +++ b/chromium/ui/base/win/touch_input.h @@ -7,16 +7,17 @@ #include <windows.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { // Wrapper for GetTouchInputInfo, which is not defined before Win7. For // earlier OS's, this function returns FALSE. -UI_BASE_EXPORT BOOL GetTouchInputInfoWrapper(HTOUCHINPUT handle, - UINT count, - PTOUCHINPUT pointer, - int size); +COMPONENT_EXPORT(UI_BASE) +BOOL GetTouchInputInfoWrapper(HTOUCHINPUT handle, + UINT count, + PTOUCHINPUT pointer, + int size); } // namespace ui diff --git a/chromium/ui/base/win/window_event_target.h b/chromium/ui/base/win/window_event_target.h index 52cfa8d3ad9..61478cb28dd 100644 --- a/chromium/ui/base/win/window_event_target.h +++ b/chromium/ui/base/win/window_event_target.h @@ -7,14 +7,14 @@ #include <windows.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { // This interface is implemented by classes who get input events forwarded to // them from others. E.g. would be a win32 parent child relationship where the // child forwards input events to the parent after doing minimal processing. -class UI_BASE_EXPORT WindowEventTarget { +class COMPONENT_EXPORT(UI_BASE) WindowEventTarget { public: static const char kWin32InputEventTarget[]; |