diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/ui/base/cocoa | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ui/base/cocoa')
33 files changed, 154 insertions, 107 deletions
diff --git a/chromium/ui/base/cocoa/accessibility_focus_overrider.h b/chromium/ui/base/cocoa/accessibility_focus_overrider.h index d8b6def31a2..7d3b88d04a7 100644 --- a/chromium/ui/base/cocoa/accessibility_focus_overrider.h +++ b/chromium/ui/base/cocoa/accessibility_focus_overrider.h @@ -5,7 +5,7 @@ #ifndef UI_BASE_COCOA_ACCESSIBILITY_FOCUS_OVERRIDER_H_ #define UI_BASE_COCOA_ACCESSIBILITY_FOCUS_OVERRIDER_H_ -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { @@ -28,7 +28,7 @@ namespace ui { // The above-required overriding of focus is done by instantiating an // AccessibilityFocusOverrider and updating its state when the NSView in the // PWA process is focused. -class UI_BASE_EXPORT AccessibilityFocusOverrider { +class COMPONENT_EXPORT(UI_BASE) AccessibilityFocusOverrider { public: class Client { public: diff --git a/chromium/ui/base/cocoa/appkit_utils.h b/chromium/ui/base/cocoa/appkit_utils.h index 14f6c55070e..a3b46d13329 100644 --- a/chromium/ui/base/cocoa/appkit_utils.h +++ b/chromium/ui/base/cocoa/appkit_utils.h @@ -7,15 +7,15 @@ #import <Cocoa/Cocoa.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { // Whether a force-click event on the touchpad should invoke Quick Look. -UI_BASE_EXPORT bool ForceClickInvokesQuickLook(); +COMPONENT_EXPORT(UI_BASE) bool ForceClickInvokesQuickLook(); // Returns true if both CGFloat values are equal. -UI_BASE_EXPORT bool IsCGFloatEqual(CGFloat a, CGFloat b); +COMPONENT_EXPORT(UI_BASE) bool IsCGFloatEqual(CGFloat a, CGFloat b); } // namespace ui diff --git a/chromium/ui/base/cocoa/base_view.h b/chromium/ui/base/cocoa/base_view.h index d9194c2f629..989196e8e19 100644 --- a/chromium/ui/base/cocoa/base_view.h +++ b/chromium/ui/base/cocoa/base_view.h @@ -7,16 +7,16 @@ #import <Cocoa/Cocoa.h> +#include "base/component_export.h" #include "base/mac/scoped_nsobject.h" #import "ui/base/cocoa/tracking_area.h" -#include "ui/base/ui_base_export.h" #include "ui/gfx/geometry/rect.h" // A view that provides common functionality that many views will need: // - Automatic registration for mouse-moved events. // - Funneling of mouse and key events to two methods // - Coordinate conversion utilities -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface BaseView : NSView { @public enum EventHandled { @@ -57,7 +57,7 @@ UI_BASE_EXPORT // The name is |kViewDidBecomeFirstResponder|, the object is the view, and the // NSSelectionDirection is wrapped in an NSNumber under the key // |kSelectionDirection|. -UI_BASE_EXPORT extern NSString* kViewDidBecomeFirstResponder; -UI_BASE_EXPORT extern NSString* kSelectionDirection; +COMPONENT_EXPORT(UI_BASE) extern NSString* kViewDidBecomeFirstResponder; +COMPONENT_EXPORT(UI_BASE) extern NSString* kSelectionDirection; #endif // UI_BASE_COCOA_BASE_VIEW_H_ diff --git a/chromium/ui/base/cocoa/base_view.mm b/chromium/ui/base/cocoa/base_view.mm index 55ecf52defd..05ac7edca8b 100644 --- a/chromium/ui/base/cocoa/base_view.mm +++ b/chromium/ui/base/cocoa/base_view.mm @@ -4,6 +4,7 @@ #include "ui/base/cocoa/base_view.h" +#include "base/check_op.h" #include "base/mac/mac_util.h" NSString* kViewDidBecomeFirstResponder = diff --git a/chromium/ui/base/cocoa/bubble_closer.h b/chromium/ui/base/cocoa/bubble_closer.h index 39a2f450d5a..806d7352726 100644 --- a/chromium/ui/base/cocoa/bubble_closer.h +++ b/chromium/ui/base/cocoa/bubble_closer.h @@ -8,9 +8,9 @@ #include <objc/objc.h> #include "base/callback.h" +#include "base/component_export.h" #include "base/macros.h" #include "ui/base/cocoa/weak_ptr_nsobject.h" -#include "ui/base/ui_base_export.h" #include "ui/gfx/native_widget_types.h" namespace ui { @@ -18,7 +18,7 @@ namespace ui { // Monitors mouse events to allow a regular window to have menu-like popup // behavior when clicking outside the window. This is needed because macOS // suppresses window activation events when clicking rapidly. -class UI_BASE_EXPORT BubbleCloser { +class COMPONENT_EXPORT(UI_BASE) BubbleCloser { public: // Installs an event monitor watching for mouse clicks outside of |window| or // any of its child windows. Invokes |on_click_outside| on each event. diff --git a/chromium/ui/base/cocoa/cocoa_base_utils.h b/chromium/ui/base/cocoa/cocoa_base_utils.h index 627fe3ba325..05c7526f8d4 100644 --- a/chromium/ui/base/cocoa/cocoa_base_utils.h +++ b/chromium/ui/base/cocoa/cocoa_base_utils.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" #include "ui/base/window_open_disposition.h" namespace ui { @@ -15,24 +15,26 @@ namespace ui { // Retrieves the WindowOpenDisposition used to open a link from a user gesture // represented by |event|. For example, a Cmd+Click would mean open the // associated link in a background tab. -UI_BASE_EXPORT WindowOpenDisposition - WindowOpenDispositionFromNSEvent(NSEvent* event); +COMPONENT_EXPORT(UI_BASE) +WindowOpenDisposition WindowOpenDispositionFromNSEvent(NSEvent* event); // Retrieves the WindowOpenDisposition used to open a link from a user gesture // represented by |event|, but instead use the modifier flags given by |flags|, // which is the same format as |-NSEvent modifierFlags|. This allows // substitution of the modifiers without having to create a new event from // scratch. -UI_BASE_EXPORT WindowOpenDisposition - WindowOpenDispositionFromNSEventWithFlags(NSEvent* event, NSUInteger flags); +COMPONENT_EXPORT(UI_BASE) +WindowOpenDisposition WindowOpenDispositionFromNSEventWithFlags( + NSEvent* event, + NSUInteger flags); // Converts a point from window coordinates to screen coordinates. -UI_BASE_EXPORT NSPoint ConvertPointFromWindowToScreen(NSWindow* window, - NSPoint point); +COMPONENT_EXPORT(UI_BASE) +NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point); // Converts a point from screen coordinates to window coordinates. -UI_BASE_EXPORT NSPoint ConvertPointFromScreenToWindow(NSWindow* window, - NSPoint point); +COMPONENT_EXPORT(UI_BASE) +NSPoint ConvertPointFromScreenToWindow(NSWindow* window, NSPoint point); } // namespace ui diff --git a/chromium/ui/base/cocoa/command_dispatcher.h b/chromium/ui/base/cocoa/command_dispatcher.h index 0fca8887e6a..1203c0a4df2 100644 --- a/chromium/ui/base/cocoa/command_dispatcher.h +++ b/chromium/ui/base/cocoa/command_dispatcher.h @@ -7,8 +7,8 @@ #import <Cocoa/Cocoa.h> +#include "base/component_export.h" #import "base/mac/scoped_nsobject.h" -#include "ui/base/ui_base_export.h" @protocol CommandDispatcherDelegate; @protocol CommandDispatchingWindow; @@ -21,7 +21,7 @@ // NSWindow can use CommandDispatcher by implementing CommandDispatchingWindow // and overriding -[NSWindow performKeyEquivalent:] and -[NSWindow sendEvent:] // to call the respective CommandDispatcher methods. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface CommandDispatcher : NSObject @property(assign, nonatomic) id<CommandDispatcherDelegate> delegate; diff --git a/chromium/ui/base/cocoa/command_dispatcher.mm b/chromium/ui/base/cocoa/command_dispatcher.mm index efe7a1862ce..1ae7b1707a7 100644 --- a/chromium/ui/base/cocoa/command_dispatcher.mm +++ b/chromium/ui/base/cocoa/command_dispatcher.mm @@ -23,6 +23,44 @@ - (NSWindow<CommandDispatchingWindow>*)bubbleParent; @end +namespace { + +// Duplicate the given key event, but changing the associated window. +NSEvent* KeyEventForWindow(NSWindow* window, NSEvent* event) { + NSEventType event_type = [event type]; + + // Convert the event's location from the original window's coordinates into + // our own. + NSPoint location = [event locationInWindow]; + location = ui::ConvertPointFromWindowToScreen([event window], location); + location = ui::ConvertPointFromScreenToWindow(window, location); + + // Various things *only* apply to key down/up. + bool is_a_repeat = false; + NSString* characters = nil; + NSString* charactors_ignoring_modifiers = nil; + if (event_type == NSKeyDown || event_type == NSKeyUp) { + is_a_repeat = [event isARepeat]; + characters = [event characters]; + charactors_ignoring_modifiers = [event charactersIgnoringModifiers]; + } + + // This synthesis may be slightly imperfect: we provide nil for the context, + // since I (viettrungluu) am sceptical that putting in the original context + // (if one is given) is valid. + return [NSEvent keyEventWithType:event_type + location:location + modifierFlags:[event modifierFlags] + timestamp:[event timestamp] + windowNumber:[window windowNumber] + context:nil + characters:characters + charactersIgnoringModifiers:charactors_ignoring_modifiers + isARepeat:is_a_repeat + keyCode:[event keyCode]]; +} + +} // namespace @implementation CommandDispatcher { @private @@ -169,10 +207,13 @@ return YES; // Pretend it's been handled in an effort to limit damage. } - // TODO(lgrey): This is a temporary sanity check since the code that was - // here previously did *not* assume this. Remove shortly after this lands if - // nothing blew up. - DCHECK_EQ([event window], _owner); + // Sometimes, an event will be redispatched from a child window to a parent + // window to allow the parent window a chance to handle it. In that case, fix + // up the native event to reference the correct window. Failure to do this can + // cause infinite redispatch loops; see https://crbug.com/1085578 for more + // details. + if ([event window] != _owner) + event = KeyEventForWindow(_owner, event); // Redispatch the event. _eventHandled = YES; diff --git a/chromium/ui/base/cocoa/constrained_window/constrained_window_animation.h b/chromium/ui/base/cocoa/constrained_window/constrained_window_animation.h index 2bc672c9840..8942102b232 100644 --- a/chromium/ui/base/cocoa/constrained_window/constrained_window_animation.h +++ b/chromium/ui/base/cocoa/constrained_window/constrained_window_animation.h @@ -7,11 +7,11 @@ #import <Cocoa/Cocoa.h> +#include "base/component_export.h" #include "base/mac/scoped_nsobject.h" -#include "ui/base/ui_base_export.h" // Base class for all constrained window animation classes. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface ConstrainedWindowAnimationBase : NSAnimation { @protected base::scoped_nsobject<NSWindow> _window; @@ -22,17 +22,17 @@ UI_BASE_EXPORT @end // An animation to show a window. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface ConstrainedWindowAnimationShow : ConstrainedWindowAnimationBase @end // An animation to hide a window. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface ConstrainedWindowAnimationHide : ConstrainedWindowAnimationBase @end // An animation that pulses the window by growing it then shrinking it back. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface ConstrainedWindowAnimationPulse : ConstrainedWindowAnimationBase @end diff --git a/chromium/ui/base/cocoa/constrained_window/constrained_window_animation.mm b/chromium/ui/base/cocoa/constrained_window/constrained_window_animation.mm index ce16e17dfcb..c8ce99f708b 100644 --- a/chromium/ui/base/cocoa/constrained_window/constrained_window_animation.mm +++ b/chromium/ui/base/cocoa/constrained_window/constrained_window_animation.mm @@ -11,6 +11,7 @@ #include "base/location.h" #import "base/mac/foundation_util.h" #include "base/native_library.h" +#include "base/notreached.h" #include "base/stl_util.h" #include "ui/gfx/animation/tween.h" diff --git a/chromium/ui/base/cocoa/controls/button_utils.h b/chromium/ui/base/cocoa/controls/button_utils.h index 740c914140a..d9b039f0fa9 100644 --- a/chromium/ui/base/cocoa/controls/button_utils.h +++ b/chromium/ui/base/cocoa/controls/button_utils.h @@ -5,11 +5,11 @@ #ifndef UI_BASE_COCOA_CONTROLS_BUTTON_UTILS_H_ #define UI_BASE_COCOA_CONTROLS_BUTTON_UTILS_H_ -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" #include <Cocoa/Cocoa.h> -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface ButtonUtils : NSObject // These methods are a polyfill for convenience constructors that exist on diff --git a/chromium/ui/base/cocoa/controls/textfield_utils.h b/chromium/ui/base/cocoa/controls/textfield_utils.h index dea04b87f0e..4fd54c6c0ea 100644 --- a/chromium/ui/base/cocoa/controls/textfield_utils.h +++ b/chromium/ui/base/cocoa/controls/textfield_utils.h @@ -5,11 +5,11 @@ #ifndef UI_BASE_COCOA_CONTROLS_TEXTFIELD_UTILS_H_ #define UI_BASE_COCOA_CONTROLS_TEXTFIELD_UTILS_H_ -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" #include <Cocoa/Cocoa.h> -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface TextFieldUtils : NSObject // This method is a polyfill for a method on NSTextField on macOS 10.12+. diff --git a/chromium/ui/base/cocoa/defaults_utils.h b/chromium/ui/base/cocoa/defaults_utils.h index ff68374f8a0..7845045d5c4 100644 --- a/chromium/ui/base/cocoa/defaults_utils.h +++ b/chromium/ui/base/cocoa/defaults_utils.h @@ -5,15 +5,15 @@ #ifndef UI_BASE_COCOA_DEFAULTS_UTILS_H_ #define UI_BASE_COCOA_DEFAULTS_UTILS_H_ +#include "base/component_export.h" #include "base/time/time.h" -#include "ui/base/ui_base_export.h" namespace ui { // Returns the text insertion caret blink period, if one is configured in // NSUserDefaults. -UI_BASE_EXPORT bool TextInsertionCaretBlinkPeriod(base::TimeDelta* period); - +COMPONENT_EXPORT(UI_BASE) +bool TextInsertionCaretBlinkPeriod(base::TimeDelta* period); } #endif diff --git a/chromium/ui/base/cocoa/find_pasteboard.h b/chromium/ui/base/cocoa/find_pasteboard.h index 4cda454dbc2..3dc0867ca8e 100644 --- a/chromium/ui/base/cocoa/find_pasteboard.h +++ b/chromium/ui/base/cocoa/find_pasteboard.h @@ -11,10 +11,10 @@ #import <Cocoa/Cocoa.h> +#include "base/component_export.h" #include "base/mac/scoped_nsobject.h" -#include "ui/base/ui_base_export.h" -UI_BASE_EXPORT extern NSString* kFindPasteboardChangedNotification; +COMPONENT_EXPORT(UI_BASE) extern NSString* kFindPasteboardChangedNotification; // Manages the find pasteboard. Use this to copy text to the find pasteboard, // to get the text currently on the find pasteboard, and to receive @@ -25,7 +25,7 @@ UI_BASE_EXPORT extern NSString* kFindPasteboardChangedNotification; // This is not thread-safe and must be used on the main thread. // // This is supposed to be a singleton. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface FindPasteboard : NSObject { @private base::scoped_nsobject<NSString> _findText; @@ -54,6 +54,6 @@ UI_BASE_EXPORT #endif // __OBJC__ // Also provide a c++ interface -UI_BASE_EXPORT base::string16 GetFindPboardText(); +COMPONENT_EXPORT(UI_BASE) base::string16 GetFindPboardText(); #endif // UI_BASE_COCOA_FIND_PASTEBOARD_H_ diff --git a/chromium/ui/base/cocoa/flipped_view.h b/chromium/ui/base/cocoa/flipped_view.h index 7bc117779d8..c5dce1a553d 100644 --- a/chromium/ui/base/cocoa/flipped_view.h +++ b/chromium/ui/base/cocoa/flipped_view.h @@ -7,13 +7,13 @@ #import <Cocoa/Cocoa.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" // A view where the Y axis is flipped such that the origin is at the top left // and Y value increases downwards. Drawing is flipped so that layout of the // sections is easier. Apple recommends flipping the coordinate origin when // doing a lot of text layout because it's more natural. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface FlippedView : NSView @end diff --git a/chromium/ui/base/cocoa/focus_tracker.h b/chromium/ui/base/cocoa/focus_tracker.h index f77559ea098..a676e08ef15 100644 --- a/chromium/ui/base/cocoa/focus_tracker.h +++ b/chromium/ui/base/cocoa/focus_tracker.h @@ -4,15 +4,15 @@ #import <Cocoa/Cocoa.h> +#include "base/component_export.h" #include "base/mac/scoped_nsobject.h" -#include "ui/base/ui_base_export.h" // A class that handles saving and restoring focus. An instance of // this class snapshots the currently focused view when it is // constructed, and callers can use restoreFocus to return focus to // that view. FocusTracker will not restore focus to views that are // no longer in the view hierarchy or are not in the correct window. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface FocusTracker : NSObject { @private base::scoped_nsobject<NSView> _focusedView; diff --git a/chromium/ui/base/cocoa/focus_window_set.h b/chromium/ui/base/cocoa/focus_window_set.h index e4b6d9f0471..820195f6978 100644 --- a/chromium/ui/base/cocoa/focus_window_set.h +++ b/chromium/ui/base/cocoa/focus_window_set.h @@ -7,7 +7,7 @@ #include <set> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" #include "ui/gfx/native_widget_types.h" namespace ui { @@ -15,7 +15,8 @@ namespace ui { // Brings a group of windows to the front without changing their order, and // makes the frontmost one key and main. If none are visible, the frontmost // miniaturized window is deminiaturized. -UI_BASE_EXPORT void FocusWindowSet(const std::set<gfx::NativeWindow>& windows); +COMPONENT_EXPORT(UI_BASE) +void FocusWindowSet(const std::set<gfx::NativeWindow>& windows); // Brings a group of windows to the front without changing their // order, and makes the frontmost one key and main. If none are @@ -24,8 +25,8 @@ UI_BASE_EXPORT void FocusWindowSet(const std::set<gfx::NativeWindow>& windows); // behavior. Unlike FocusWindowSet, only windows on the current space // are considered. It also ignores the hidden state of windows; the // window system may be in the middle of unhiding the application. -UI_BASE_EXPORT void FocusWindowSetOnCurrentSpace( - const std::set<gfx::NativeWindow>& windows); +COMPONENT_EXPORT(UI_BASE) +void FocusWindowSetOnCurrentSpace(const std::set<gfx::NativeWindow>& windows); } // namespace ui diff --git a/chromium/ui/base/cocoa/focus_window_set.mm b/chromium/ui/base/cocoa/focus_window_set.mm index 498df6e2951..06e7223ded8 100644 --- a/chromium/ui/base/cocoa/focus_window_set.mm +++ b/chromium/ui/base/cocoa/focus_window_set.mm @@ -4,6 +4,7 @@ #import <Cocoa/Cocoa.h> +#include "base/check.h" #include "ui/base/cocoa/focus_window_set.h" namespace ui { diff --git a/chromium/ui/base/cocoa/menu_controller.h b/chromium/ui/base/cocoa/menu_controller.h index d6dd4f0ced2..8dc3cdb50a5 100644 --- a/chromium/ui/base/cocoa/menu_controller.h +++ b/chromium/ui/base/cocoa/menu_controller.h @@ -7,9 +7,9 @@ #import <Cocoa/Cocoa.h> +#include "base/component_export.h" #include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" -#include "ui/base/ui_base_export.h" namespace ui { class MenuModel; @@ -21,7 +21,7 @@ class MenuModel; // allow for hierarchical menus). The tag is the index into that model for // that particular item. It is important that the model outlives this object // as it only maintains weak references. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface MenuControllerCocoa : NSObject<NSMenuDelegate, NSUserInterfaceValidations> diff --git a/chromium/ui/base/cocoa/permissions_utils.h b/chromium/ui/base/cocoa/permissions_utils.h index 14355053988..a8ec034cdf2 100644 --- a/chromium/ui/base/cocoa/permissions_utils.h +++ b/chromium/ui/base/cocoa/permissions_utils.h @@ -5,7 +5,7 @@ #ifndef UI_BASE_COCOA_PERMISSIONS_UTILS_H_ #define UI_BASE_COCOA_PERMISSIONS_UTILS_H_ -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { @@ -14,7 +14,7 @@ namespace ui { // requires a permission authorization. There is no direct way to query the // permission state, so this uses a heuristic to evaluate whether the permission // has been granted. -UI_BASE_EXPORT bool IsScreenCaptureAllowed(); +COMPONENT_EXPORT(UI_BASE) bool IsScreenCaptureAllowed(); } // namespace ui diff --git a/chromium/ui/base/cocoa/quartz_util.h b/chromium/ui/base/cocoa/quartz_util.h index dd3201fe925..bba1f2016e5 100644 --- a/chromium/ui/base/cocoa/quartz_util.h +++ b/chromium/ui/base/cocoa/quartz_util.h @@ -5,15 +5,15 @@ #ifndef UI_BASE_COCOA_QUARTZ_UTIL_H_ #define UI_BASE_COCOA_QUARTZ_UTIL_H_ -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { // Calls +[CATransaction begin]. -UI_BASE_EXPORT void BeginCATransaction(); +COMPONENT_EXPORT(UI_BASE) void BeginCATransaction(); // Calls +[CATransaction commit]. -UI_BASE_EXPORT void CommitCATransaction(); +COMPONENT_EXPORT(UI_BASE) void CommitCATransaction(); } // namespace ui diff --git a/chromium/ui/base/cocoa/remote_accessibility_api.h b/chromium/ui/base/cocoa/remote_accessibility_api.h index 2a58aebabb2..e7adfee3210 100644 --- a/chromium/ui/base/cocoa/remote_accessibility_api.h +++ b/chromium/ui/base/cocoa/remote_accessibility_api.h @@ -8,8 +8,8 @@ #import <Cocoa/Cocoa.h> #include <vector> +#include "base/component_export.h" #include "base/mac/scoped_nsobject.h" -#include "ui/base/ui_base_export.h" @interface NSAccessibilityRemoteUIElement : NSObject + (void)registerRemoteUIProcessIdentifier:(int)pid; @@ -23,7 +23,7 @@ namespace ui { // Helper functions to implement the above functions using std::vectors intsead // of NSData. -class UI_BASE_EXPORT RemoteAccessibility { +class COMPONENT_EXPORT(UI_BASE) RemoteAccessibility { public: static std::vector<uint8_t> GetTokenForLocalElement(id element); static base::scoped_nsobject<NSAccessibilityRemoteUIElement> diff --git a/chromium/ui/base/cocoa/remote_layer_api.h b/chromium/ui/base/cocoa/remote_layer_api.h index 2057fe69d1b..d684614589c 100644 --- a/chromium/ui/base/cocoa/remote_layer_api.h +++ b/chromium/ui/base/cocoa/remote_layer_api.h @@ -11,7 +11,7 @@ #include <stdint.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" // The CGSConnectionID is used to create the CAContext in the process that is // going to share the CALayers that it is rendering to another process to @@ -54,7 +54,7 @@ namespace ui { // This function will check if all of the interfaces listed above are supported // on the system, and return true if they are. -bool UI_BASE_EXPORT RemoteLayerAPISupported(); +bool COMPONENT_EXPORT(UI_BASE) RemoteLayerAPISupported(); } // namespace ui diff --git a/chromium/ui/base/cocoa/secure_password_input.h b/chromium/ui/base/cocoa/secure_password_input.h index ca90d3964a5..d272cd1bd6a 100644 --- a/chromium/ui/base/cocoa/secure_password_input.h +++ b/chromium/ui/base/cocoa/secure_password_input.h @@ -5,13 +5,13 @@ #ifndef UI_BASE_COCOA_SECURE_PASSWORD_INPUT_H_ #define UI_BASE_COCOA_SECURE_PASSWORD_INPUT_H_ +#include "base/component_export.h" #include "base/macros.h" -#include "ui/base/ui_base_export.h" namespace ui { // Enables the secure password input mode while in scope. -class UI_BASE_EXPORT ScopedPasswordInputEnabler { +class COMPONENT_EXPORT(UI_BASE) ScopedPasswordInputEnabler { public: ScopedPasswordInputEnabler(); ~ScopedPasswordInputEnabler(); diff --git a/chromium/ui/base/cocoa/text_services_context_menu.cc b/chromium/ui/base/cocoa/text_services_context_menu.cc index d149dd8df63..0dcfe6db2b4 100644 --- a/chromium/ui/base/cocoa/text_services_context_menu.cc +++ b/chromium/ui/base/cocoa/text_services_context_menu.cc @@ -17,22 +17,6 @@ namespace { -enum MenuCommands { - // These must not overlap with the command IDs used by other menus that - // incorporate text services. - // TODO(ellyjones): This is an ugly global dependency, especially on - // //ui/views. What can we do about this? Can we get rid of the global - // implicit namespace of command IDs? - kSpeechMenu = 100, - kSpeechStartSpeaking, - kSpeechStopSpeaking, - - kWritingDirectionMenu, - kWritingDirectionDefault, - kWritingDirectionLtr, - kWritingDirectionRtl, -}; - // The speech channel used for speaking. This is shared to check if a speech // channel is currently speaking. SpeechChannel g_speech_channel; @@ -41,11 +25,11 @@ SpeechChannel g_speech_channel; // |command_id|. base::i18n::TextDirection GetTextDirectionFromCommandId(int command_id) { switch (command_id) { - case kWritingDirectionDefault: + case ui::TextServicesContextMenu::kWritingDirectionDefault: return base::i18n::UNKNOWN_DIRECTION; - case kWritingDirectionLtr: + case ui::TextServicesContextMenu::kWritingDirectionLtr: return base::i18n::LEFT_TO_RIGHT; - case kWritingDirectionRtl: + case ui::TextServicesContextMenu::kWritingDirectionRtl: return base::i18n::RIGHT_TO_LEFT; default: NOTREACHED(); diff --git a/chromium/ui/base/cocoa/text_services_context_menu.h b/chromium/ui/base/cocoa/text_services_context_menu.h index e9d48efa68c..a32b76f9523 100644 --- a/chromium/ui/base/cocoa/text_services_context_menu.h +++ b/chromium/ui/base/cocoa/text_services_context_menu.h @@ -5,20 +5,36 @@ #ifndef UI_BASE_COCOA_TEXT_SERVICES_CONTEXT_MENU_H_ #define UI_BASE_COCOA_TEXT_SERVICES_CONTEXT_MENU_H_ +#include "base/component_export.h" #include "base/i18n/rtl.h" #include "base/macros.h" #include "base/strings/string16.h" #include "ui/base/models/simple_menu_model.h" -#include "ui/base/ui_base_export.h" namespace ui { // This class is used to append and handle the Speech and BiDi submenu for the // context menu. -class UI_BASE_EXPORT TextServicesContextMenu +class COMPONENT_EXPORT(UI_BASE) TextServicesContextMenu : public SimpleMenuModel::Delegate { public: - class UI_BASE_EXPORT Delegate { + enum MenuCommands { + // These must not overlap with the command IDs used by other menus that + // incorporate text services. + // TODO(ellyjones): This is an ugly global dependency, especially on + // //ui/views. What can we do about this? Can we get rid of the global + // implicit namespace of command IDs? + kSpeechMenu = 100, + kSpeechStartSpeaking, + kSpeechStopSpeaking, + + kWritingDirectionMenu, + kWritingDirectionDefault, + kWritingDirectionLtr, + kWritingDirectionRtl, + }; + + class COMPONENT_EXPORT(UI_BASE) Delegate { public: // Returns the selected text. virtual base::string16 GetSelectedText() const = 0; diff --git a/chromium/ui/base/cocoa/tool_tip_base_view.h b/chromium/ui/base/cocoa/tool_tip_base_view.h index 086530a4894..32d354fd525 100644 --- a/chromium/ui/base/cocoa/tool_tip_base_view.h +++ b/chromium/ui/base/cocoa/tool_tip_base_view.h @@ -7,12 +7,13 @@ #import <AppKit/AppKit.h> +#include "base/component_export.h" #import "ui/base/cocoa/base_view.h" // An NSiew that allows tooltip text to be set at the current mouse location. It // can take effect immediately, but won't appear unless the tooltip delay has // elapsed. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface ToolTipBaseView : BaseView { @private // These are part of the magic tooltip code from WebKit's WebHTMLView: diff --git a/chromium/ui/base/cocoa/touch_bar_util.h b/chromium/ui/base/cocoa/touch_bar_util.h index 457099bd9a5..f69d2a392f1 100644 --- a/chromium/ui/base/cocoa/touch_bar_util.h +++ b/chromium/ui/base/cocoa/touch_bar_util.h @@ -8,7 +8,7 @@ #import <Cocoa/Cocoa.h> #include <os/availability.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" namespace ui { @@ -29,30 +29,29 @@ enum TouchBarAction { }; // Logs the sample's UMA metrics into the DefaultTouchBar.Metrics histogram. -UI_BASE_EXPORT void LogTouchBarUMA(TouchBarAction command); +COMPONENT_EXPORT(UI_BASE) void LogTouchBarUMA(TouchBarAction command); // Returns the NSTouchBar Class. -UI_BASE_EXPORT Class NSTouchBar(); +COMPONENT_EXPORT(UI_BASE) Class NSTouchBar(); // Returns the NSCustomTouchBarItem Class. -UI_BASE_EXPORT Class NSCustomTouchBarItem(); +COMPONENT_EXPORT(UI_BASE) Class NSCustomTouchBarItem(); // Returns the NSGroupTouchBarItem Class. -UI_BASE_EXPORT Class NSGroupTouchBarItem(); +COMPONENT_EXPORT(UI_BASE) Class NSGroupTouchBarItem(); // Returns a stylized blue button for the touch bar. The button performs // |action| from the |target|. API_AVAILABLE(macosx(10.12.2)) -UI_BASE_EXPORT NSButton* GetBlueTouchBarButton(NSString* title, - id target, - SEL action); +COMPONENT_EXPORT(UI_BASE) +NSButton* GetBlueTouchBarButton(NSString* title, id target, SEL action); // Creates a touch bar identifier with the given |id|. -UI_BASE_EXPORT NSString* GetTouchBarId(NSString* touch_bar_id); +COMPONENT_EXPORT(UI_BASE) NSString* GetTouchBarId(NSString* touch_bar_id); // Creates a touch Bar jtem identifier. -UI_BASE_EXPORT NSString* GetTouchBarItemId(NSString* touch_bar_id, - NSString* item_id); +COMPONENT_EXPORT(UI_BASE) +NSString* GetTouchBarItemId(NSString* touch_bar_id, NSString* item_id); } // namespace ui diff --git a/chromium/ui/base/cocoa/tracking_area.h b/chromium/ui/base/cocoa/tracking_area.h index 4d7cd334e72..9d4c1c42783 100644 --- a/chromium/ui/base/cocoa/tracking_area.h +++ b/chromium/ui/base/cocoa/tracking_area.h @@ -7,15 +7,15 @@ #import <AppKit/AppKit.h> +#include "base/component_export.h" #include "base/mac/scoped_nsobject.h" #include "base/macros.h" -#include "ui/base/ui_base_export.h" @class CrTrackingAreaOwnerProxy; // The CrTrackingArea can be used in place of an NSTrackingArea to shut off // messaging to the |owner| at a specific point in time. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface CrTrackingArea : NSTrackingArea { @private base::scoped_nsobject<CrTrackingAreaOwnerProxy> _ownerProxy; @@ -39,7 +39,7 @@ namespace ui { // Use an instance of this class to call |-clearOwner| on the |tracking_area_| // when this goes out of scope. -class UI_BASE_EXPORT ScopedCrTrackingArea { +class COMPONENT_EXPORT(UI_BASE) ScopedCrTrackingArea { public: // Takes ownership of |tracking_area| without retaining it. explicit ScopedCrTrackingArea(CrTrackingArea* tracking_area = nil); diff --git a/chromium/ui/base/cocoa/underlay_opengl_hosting_window.h b/chromium/ui/base/cocoa/underlay_opengl_hosting_window.h index d673c31a0f3..ec1c6c972ee 100644 --- a/chromium/ui/base/cocoa/underlay_opengl_hosting_window.h +++ b/chromium/ui/base/cocoa/underlay_opengl_hosting_window.h @@ -7,12 +7,12 @@ #import <Cocoa/Cocoa.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" // Common base class for windows that host a OpenGL surface that renders under // the window. Previously contained methods related to hole punching, now just // contains common asserts. -UI_BASE_EXPORT +COMPONENT_EXPORT(UI_BASE) @interface UnderlayOpenGLHostingWindow : NSWindow @end diff --git a/chromium/ui/base/cocoa/views_hostable.h b/chromium/ui/base/cocoa/views_hostable.h index 46f0277491f..9a9ae9324a5 100644 --- a/chromium/ui/base/cocoa/views_hostable.h +++ b/chromium/ui/base/cocoa/views_hostable.h @@ -7,7 +7,7 @@ #import <objc/objc.h> -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/native_widget_types.h" diff --git a/chromium/ui/base/cocoa/weak_ptr_nsobject.h b/chromium/ui/base/cocoa/weak_ptr_nsobject.h index fa9580e94ec..6d50aa00b9e 100644 --- a/chromium/ui/base/cocoa/weak_ptr_nsobject.h +++ b/chromium/ui/base/cocoa/weak_ptr_nsobject.h @@ -5,8 +5,8 @@ #ifndef UI_BASE_COCOA_WEAK_PTR_NSOBJECT_H_ #define UI_BASE_COCOA_WEAK_PTR_NSOBJECT_H_ +#include "base/component_export.h" #include "base/macros.h" -#include "ui/base/ui_base_export.h" #if defined(__OBJC__) @class WeakPtrNSObject; @@ -20,7 +20,7 @@ namespace internal { // Non-templatized base for WeakPtrNSObjectFactory with utility functions. This // mainly serves to hide the objective-C code from the header, so it can be // included in cc files. -class UI_BASE_EXPORT WeakPtrNSObjectFactoryBase { +class COMPONENT_EXPORT(UI_BASE) WeakPtrNSObjectFactoryBase { protected: static WeakPtrNSObject* Create(void* owner); static void* UnWrap(WeakPtrNSObject* handle); diff --git a/chromium/ui/base/cocoa/window_size_constants.h b/chromium/ui/base/cocoa/window_size_constants.h index bb94018fd53..0f096c95629 100644 --- a/chromium/ui/base/cocoa/window_size_constants.h +++ b/chromium/ui/base/cocoa/window_size_constants.h @@ -5,14 +5,14 @@ #ifndef UI_BASE_COCOA_WINDOW_SIZE_CONSTANTS_H_ #define UI_BASE_COCOA_WINDOW_SIZE_CONSTANTS_H_ -#include "ui/base/ui_base_export.h" +#include "base/component_export.h" #import <Foundation/Foundation.h> namespace ui { // It is not valid to make a zero-sized window. Use this constant instead. -UI_BASE_EXPORT extern const NSRect kWindowSizeDeterminedLater; +COMPONENT_EXPORT(UI_BASE) extern const NSRect kWindowSizeDeterminedLater; } // namespace ui |