Commit 55319091 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

RemoteRWHVMac: Rename LocalClient to ClientHelper

The interface RenderWidgetHostNSViewLocalClient provides a set of helper
functions that add functionality to a RenderWidgetHostNSViewClient.
These functions may be implemented directly using that Client, or using
a side-channel.

The naming of this class is very confusing as we add the ability to have
local (in-process) and remote (out-of-process) clients. To this end,
rename this to a name that more closely mirrors the names in ui/views
and doesn't these naming ambiguities.

Move the ForwardingLocalClient from render_widget_host_view_cocoa.mm
over to a new render_widget_host_ns_view_client_helper.mm. Change
the instance which is created as a dummy pipe to always be identified
as a dummy pipe.

Bug: 821651
Change-Id: I1dd130ddbed46d4854a065fa3d629b7f9833824c
Reviewed-on: https://chromium-review.googlesource.com/1239641Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593601}
parent f75989c1
......@@ -2346,7 +2346,8 @@ jumbo_source_set("browser") {
"renderer_host/popup_window_mac.mm",
"renderer_host/render_widget_host_ns_view_bridge_local.h",
"renderer_host/render_widget_host_ns_view_bridge_local.mm",
"renderer_host/render_widget_host_ns_view_client.h",
"renderer_host/render_widget_host_ns_view_client_helper.h",
"renderer_host/render_widget_host_ns_view_client_helper.mm",
"renderer_host/render_widget_host_view_cocoa.h",
"renderer_host/render_widget_host_view_cocoa.mm",
]
......
......@@ -26,7 +26,7 @@ class RenderWidgetHostNSViewBridgeLocal
public:
RenderWidgetHostNSViewBridgeLocal(
mojom::RenderWidgetHostNSViewClient* client,
RenderWidgetHostNSViewLocalClient* local_client);
RenderWidgetHostNSViewClientHelper* client_helper);
~RenderWidgetHostNSViewBridgeLocal() override;
// TODO(ccameron): RenderWidgetHostViewMac and other functions currently use
......
......@@ -17,12 +17,12 @@ namespace content {
RenderWidgetHostNSViewBridgeLocal::RenderWidgetHostNSViewBridgeLocal(
mojom::RenderWidgetHostNSViewClient* client,
RenderWidgetHostNSViewLocalClient* local_client) {
RenderWidgetHostNSViewClientHelper* client_helper) {
display::Screen::GetScreen()->AddObserver(this);
cocoa_view_.reset([[RenderWidgetHostViewCocoa alloc]
initWithClient:client
withLocalClient:local_client]);
initWithClient:client
withClientHelper:client_helper]);
background_layer_.reset([[CALayer alloc] init]);
display_ca_layer_tree_ =
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_NS_VIEW_CLIENT_H_
#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_NS_VIEW_CLIENT_H_
#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_NS_VIEW_CLIENT_HELPER_H_
#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_NS_VIEW_CLIENT_HELPER_H_
#include "base/macros.h"
......@@ -22,6 +22,10 @@ class LatencyInfo;
namespace content {
namespace mojom {
class RenderWidgetHostNSViewClient;
} // namespace mojom
class BrowserAccessibilityManager;
struct EditCommand;
struct NativeWebKeyboardEvent;
......@@ -32,10 +36,16 @@ struct NativeWebKeyboardEvent;
// instantiated in the local process. This is to implement functions that
// cannot be sent across mojo (e.g, GetRootBrowserAccessibilityManager), or
// to avoid unnecessary translation of event types.
class RenderWidgetHostNSViewLocalClient {
class RenderWidgetHostNSViewClientHelper {
public:
RenderWidgetHostNSViewLocalClient() {}
virtual ~RenderWidgetHostNSViewLocalClient() {}
// Create a RenderWidgetHostNSViewClientHelper that will only implement
// functionality through mojo (this is in contrast with an in-process
// RenderWidgetHostNSViewClientHelper that would use raw pointer access).
static std::unique_ptr<RenderWidgetHostNSViewClientHelper>
CreateForMojoClient(content::mojom::RenderWidgetHostNSViewClient* client);
RenderWidgetHostNSViewClientHelper() {}
virtual ~RenderWidgetHostNSViewClientHelper() {}
// Return the RenderWidget's BrowserAccessibilityManager.
// TODO(ccameron): This returns nullptr for non-local NSViews. A scheme for
......@@ -73,9 +83,9 @@ class RenderWidgetHostNSViewLocalClient {
const blink::WebGestureEvent& smart_magnify_event) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostNSViewLocalClient);
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostNSViewClientHelper);
};
} // namespace content
#endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_NS_VIEW_CLIENT_H_
#endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_NS_VIEW_CLIENT_HELPER_H_
// 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.
#include "render_widget_host_ns_view_client_helper.h"
#include "content/browser/renderer_host/input/web_input_event_builders_mac.h"
#include "content/common/render_widget_host_ns_view.mojom.h"
#include "content/public/browser/native_web_keyboard_event.h"
namespace content {
namespace {
class ForwardingClientHelper : public RenderWidgetHostNSViewClientHelper {
public:
explicit ForwardingClientHelper(mojom::RenderWidgetHostNSViewClient* client)
: client_(client) {}
private:
std::unique_ptr<InputEvent> TranslateEvent(
const blink::WebInputEvent& web_event) {
return std::make_unique<InputEvent>(web_event, ui::LatencyInfo());
}
// RenderWidgetHostNSViewClientHelper implementation.
BrowserAccessibilityManager* GetRootBrowserAccessibilityManager() override {
return nullptr;
}
void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event,
const ui::LatencyInfo& latency_info) override {
const blink::WebKeyboardEvent* web_event =
static_cast<const blink::WebKeyboardEvent*>(&key_event);
std::unique_ptr<InputEvent> input_event =
std::make_unique<InputEvent>(*web_event, latency_info);
client_->ForwardKeyboardEvent(std::move(input_event),
key_event.skip_in_browser);
}
void ForwardKeyboardEventWithCommands(
const NativeWebKeyboardEvent& key_event,
const ui::LatencyInfo& latency_info,
const std::vector<EditCommand>& commands) override {
const blink::WebKeyboardEvent* web_event =
static_cast<const blink::WebKeyboardEvent*>(&key_event);
std::unique_ptr<InputEvent> input_event =
std::make_unique<InputEvent>(*web_event, latency_info);
client_->ForwardKeyboardEventWithCommands(
std::move(input_event), key_event.skip_in_browser, commands);
}
void RouteOrProcessMouseEvent(
const blink::WebMouseEvent& web_event) override {
client_->RouteOrProcessMouseEvent(TranslateEvent(web_event));
}
void RouteOrProcessTouchEvent(
const blink::WebTouchEvent& web_event) override {
client_->RouteOrProcessTouchEvent(TranslateEvent(web_event));
}
void RouteOrProcessWheelEvent(
const blink::WebMouseWheelEvent& web_event) override {
client_->RouteOrProcessWheelEvent(TranslateEvent(web_event));
}
void ForwardMouseEvent(const blink::WebMouseEvent& web_event) override {
client_->ForwardMouseEvent(TranslateEvent(web_event));
}
void ForwardWheelEvent(const blink::WebMouseWheelEvent& web_event) override {
client_->ForwardWheelEvent(TranslateEvent(web_event));
}
void GestureBegin(blink::WebGestureEvent begin_event,
bool is_synthetically_injected) override {
// The gesture type is not yet known, but assign a type to avoid
// serialization asserts (the type will be stripped on the other side).
begin_event.SetType(blink::WebInputEvent::kGestureScrollBegin);
client_->GestureBegin(TranslateEvent(begin_event),
is_synthetically_injected);
}
void GestureUpdate(blink::WebGestureEvent update_event) override {
client_->GestureUpdate(TranslateEvent(update_event));
}
void GestureEnd(blink::WebGestureEvent end_event) override {
client_->GestureEnd(TranslateEvent(end_event));
}
void SmartMagnify(const blink::WebGestureEvent& web_event) override {
client_->SmartMagnify(TranslateEvent(web_event));
}
mojom::RenderWidgetHostNSViewClient* client_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(ForwardingClientHelper);
};
} // namespace
// static
std::unique_ptr<RenderWidgetHostNSViewClientHelper>
RenderWidgetHostNSViewClientHelper::CreateForMojoClient(
content::mojom::RenderWidgetHostNSViewClient* client) {
return std::make_unique<ForwardingClientHelper>(client);
}
} // namespace content
......@@ -31,7 +31,7 @@ namespace mojom {
class RenderWidgetHostNSViewClient;
}
class RenderWidgetHostNSViewLocalClient;
class RenderWidgetHostNSViewClientHelper;
class RenderWidgetHostViewMac;
class RenderWidgetHostViewMacEditCommandHelper;
}
......@@ -68,15 +68,13 @@ struct DidOverscrollParams;
// This includes events (where the extra translation is unnecessary or loses
// information) and access to accessibility structures (only present in the
// browser process).
content::RenderWidgetHostNSViewLocalClient* localClient_;
content::RenderWidgetHostNSViewClientHelper* clientHelper_;
// An implementation of the in-process interface that will translate and
// forward messages through |client_|.
std::unique_ptr<content::RenderWidgetHostNSViewLocalClient>
forwardingLocalClient_;
// Dummy client that is always valid (see above comments about client_).
// Dummy client and client helper that are always valid (see above comments
// about client_).
content::mojom::RenderWidgetHostNSViewClientPtr dummyClient_;
std::unique_ptr<content::RenderWidgetHostNSViewClientHelper>
dummyClientHelper_;
// This ivar is the cocoa delegate of the NSResponder.
base::scoped_nsobject<NSObject<RenderWidgetHostViewMacDelegate>>
......@@ -251,7 +249,7 @@ struct DidOverscrollParams;
// Methods previously marked as private.
- (id)initWithClient:(content::mojom::RenderWidgetHostNSViewClient*)client
withLocalClient:(content::RenderWidgetHostNSViewLocalClient*)localClient;
withClientHelper:(content::RenderWidgetHostNSViewClientHelper*)clientHelper;
- (void)setResponderDelegate:
(NSObject<RenderWidgetHostViewMacDelegate>*)delegate;
- (void)processedGestureScrollEvent:(const blink::WebGestureEvent&)event
......
......@@ -38,7 +38,7 @@ using content::EditCommand;
using content::InputEvent;
using content::NativeWebKeyboardEvent;
using content::mojom::RenderWidgetHostNSViewClient;
using content::RenderWidgetHostNSViewLocalClient;
using content::RenderWidgetHostNSViewClientHelper;
using content::RenderWidgetHostViewMacEditCommandHelper;
using content::WebGestureEventBuilder;
using content::WebMouseEventBuilder;
......@@ -52,82 +52,6 @@ using blink::WebTouchEvent;
namespace {
class ForwardingLocalClient : public RenderWidgetHostNSViewLocalClient {
public:
explicit ForwardingLocalClient(RenderWidgetHostNSViewClient* client)
: client_(client) {}
private:
std::unique_ptr<InputEvent> TranslateEvent(
const blink::WebInputEvent& web_event) {
return std::make_unique<InputEvent>(web_event, ui::LatencyInfo());
}
// RenderWidgetHostNSViewLocalClient implementation.
BrowserAccessibilityManager* GetRootBrowserAccessibilityManager() override {
return nullptr;
}
void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event,
const ui::LatencyInfo& latency_info) override {
const blink::WebKeyboardEvent* web_event =
static_cast<const blink::WebKeyboardEvent*>(&key_event);
std::unique_ptr<InputEvent> input_event =
std::make_unique<InputEvent>(*web_event, latency_info);
client_->ForwardKeyboardEvent(std::move(input_event),
key_event.skip_in_browser);
}
void ForwardKeyboardEventWithCommands(
const NativeWebKeyboardEvent& key_event,
const ui::LatencyInfo& latency_info,
const std::vector<EditCommand>& commands) override {
const blink::WebKeyboardEvent* web_event =
static_cast<const blink::WebKeyboardEvent*>(&key_event);
std::unique_ptr<InputEvent> input_event =
std::make_unique<InputEvent>(*web_event, latency_info);
client_->ForwardKeyboardEventWithCommands(
std::move(input_event), key_event.skip_in_browser, commands);
}
void RouteOrProcessMouseEvent(
const blink::WebMouseEvent& web_event) override {
client_->RouteOrProcessMouseEvent(TranslateEvent(web_event));
}
void RouteOrProcessTouchEvent(
const blink::WebTouchEvent& web_event) override {
client_->RouteOrProcessTouchEvent(TranslateEvent(web_event));
}
void RouteOrProcessWheelEvent(
const blink::WebMouseWheelEvent& web_event) override {
client_->RouteOrProcessWheelEvent(TranslateEvent(web_event));
}
void ForwardMouseEvent(const blink::WebMouseEvent& web_event) override {
client_->ForwardMouseEvent(TranslateEvent(web_event));
}
void ForwardWheelEvent(const blink::WebMouseWheelEvent& web_event) override {
client_->ForwardWheelEvent(TranslateEvent(web_event));
}
void GestureBegin(blink::WebGestureEvent begin_event,
bool is_synthetically_injected) override {
// The gesture type is not yet known, but assign a type to avoid
// serialization asserts (the type will be stripped on the other side).
begin_event.SetType(blink::WebInputEvent::kGestureScrollBegin);
client_->GestureBegin(TranslateEvent(begin_event),
is_synthetically_injected);
}
void GestureUpdate(blink::WebGestureEvent update_event) override {
client_->GestureUpdate(TranslateEvent(update_event));
}
void GestureEnd(blink::WebGestureEvent end_event) override {
client_->GestureEnd(TranslateEvent(end_event));
}
void SmartMagnify(const blink::WebGestureEvent& web_event) override {
client_->SmartMagnify(TranslateEvent(web_event));
}
RenderWidgetHostNSViewClient* client_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(ForwardingLocalClient);
};
// Whether a keyboard event has been reserved by OSX.
BOOL EventIsReservedBySystem(NSEvent* event) {
content::SystemHotkeyHelperMac* helper =
......@@ -213,7 +137,7 @@ void ExtractUnderlines(NSAttributedString* string,
@synthesize textInputType = textInputType_;
- (id)initWithClient:(RenderWidgetHostNSViewClient*)client
withLocalClient:(RenderWidgetHostNSViewLocalClient*)localClient {
withClientHelper:(RenderWidgetHostNSViewClientHelper*)clientHelper {
self = [super initWithFrame:NSZeroRect];
if (self) {
self.acceptsTouchEvents = YES;
......@@ -221,12 +145,7 @@ void ExtractUnderlines(NSAttributedString* string,
editCommandHelper_->AddEditingSelectorsToClass([self class]);
client_ = client;
if (localClient) {
localClient_ = localClient;
} else {
forwardingLocalClient_ = std::make_unique<ForwardingLocalClient>(client_);
localClient_ = forwardingLocalClient_.get();
}
clientHelper_ = clientHelper;
canBeKeyView_ = YES;
isStylusEnteringProximity_ = false;
keyboardLockActive_ = false;
......@@ -373,13 +292,14 @@ void ExtractUnderlines(NSAttributedString* string,
}
- (void)setClientDisconnected {
// Set the client to be an abandoned message pipe, and set the localClient
// Set the client to be an abandoned message pipe, and set the clientHelper
// to forward messages to that client.
content::mojom::RenderWidgetHostNSViewClientRequest dummyClientRequest =
mojo::MakeRequest(&dummyClient_);
dummyClientHelper_ = RenderWidgetHostNSViewClientHelper::CreateForMojoClient(
dummyClient_.get());
client_ = dummyClient_.get();
forwardingLocalClient_ = std::make_unique<ForwardingLocalClient>(client_);
localClient_ = forwardingLocalClient_.get();
clientHelper_ = dummyClientHelper_.get();
// |responderDelegate_| may attempt to access the RenderWidgetHostViewMac
// through its internal pointers, so detach it here.
......@@ -422,7 +342,7 @@ void ExtractUnderlines(NSAttributedString* string,
WebMouseEvent web_event = WebMouseEventBuilder::Build(event, self);
web_event.SetModifiers(web_event.GetModifiers() |
WebInputEvent::kRelativeMotionEvent);
localClient_->ForwardMouseEvent(web_event);
clientHelper_->ForwardMouseEvent(web_event);
}
- (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent {
......@@ -512,7 +432,7 @@ void ExtractUnderlines(NSAttributedString* string,
WebMouseEventBuilder::Build(theEvent, self, pointerType_);
exitEvent.SetType(WebInputEvent::kMouseLeave);
exitEvent.button = WebMouseEvent::Button::kNoButton;
localClient_->ForwardMouseEvent(exitEvent);
clientHelper_->ForwardMouseEvent(exitEvent);
}
mouseEventWasIgnored_ = YES;
return;
......@@ -525,7 +445,7 @@ void ExtractUnderlines(NSAttributedString* string,
WebMouseEventBuilder::Build(theEvent, self, pointerType_);
enterEvent.SetType(WebInputEvent::kMouseMove);
enterEvent.button = WebMouseEvent::Button::kNoButton;
localClient_->RouteOrProcessMouseEvent(enterEvent);
clientHelper_->RouteOrProcessMouseEvent(enterEvent);
}
mouseEventWasIgnored_ = NO;
......@@ -579,10 +499,10 @@ void ExtractUnderlines(NSAttributedString* string,
if (!send_touch) {
WebMouseEvent event =
WebMouseEventBuilder::Build(theEvent, self, pointerType_);
localClient_->RouteOrProcessMouseEvent(event);
clientHelper_->RouteOrProcessMouseEvent(event);
} else {
WebTouchEvent event = WebTouchEventBuilder::Build(theEvent, self);
localClient_->RouteOrProcessTouchEvent(event);
clientHelper_->RouteOrProcessTouchEvent(event);
}
}
......@@ -729,7 +649,7 @@ void ExtractUnderlines(NSAttributedString* string,
// We only handle key down events and just simply forward other events.
if (eventType != NSKeyDown) {
localClient_->ForwardKeyboardEvent(event, latency_info);
clientHelper_->ForwardKeyboardEvent(event, latency_info);
// Possibly autohide the cursor.
if (shouldAutohideCursor) {
......@@ -787,7 +707,7 @@ void ExtractUnderlines(NSAttributedString* string,
NativeWebKeyboardEvent fakeEvent = event;
fakeEvent.windows_key_code = 0xE5; // VKEY_PROCESSKEY
fakeEvent.skip_in_browser = true;
localClient_->ForwardKeyboardEvent(fakeEvent, latency_info);
clientHelper_->ForwardKeyboardEvent(fakeEvent, latency_info);
// If this key event was handled by the input method, but
// -doCommandBySelector: (invoked by the call to -interpretKeyEvents: above)
// enqueued edit commands, then in order to let webkit handle them
......@@ -798,8 +718,8 @@ void ExtractUnderlines(NSAttributedString* string,
if (hasEditCommands_ && !hasMarkedText_)
delayEventUntilAfterImeCompostion = YES;
} else {
localClient_->ForwardKeyboardEventWithCommands(event, latency_info,
editCommands_);
clientHelper_->ForwardKeyboardEventWithCommands(event, latency_info,
editCommands_);
}
// Then send keypress and/or composition related events.
......@@ -857,8 +777,8 @@ void ExtractUnderlines(NSAttributedString* string,
fakeEvent.skip_in_browser = true;
ui::LatencyInfo fake_event_latency_info = latency_info;
fake_event_latency_info.set_source_event_type(ui::SourceEventType::OTHER);
localClient_->ForwardKeyboardEvent(fakeEvent, fake_event_latency_info);
localClient_->ForwardKeyboardEventWithCommands(
clientHelper_->ForwardKeyboardEvent(fakeEvent, fake_event_latency_info);
clientHelper_->ForwardKeyboardEventWithCommands(
event, fake_event_latency_info, editCommands_);
}
......@@ -872,7 +792,7 @@ void ExtractUnderlines(NSAttributedString* string,
event.text[0] = textToBeInserted_[0];
event.text[1] = 0;
event.skip_in_browser = true;
localClient_->ForwardKeyboardEvent(event, latency_info);
clientHelper_->ForwardKeyboardEvent(event, latency_info);
} else if ((!textInserted || delayEventUntilAfterImeCompostion) &&
event.text[0] != '\0' &&
((modifierFlags & kCtrlCmdKeyMask) ||
......@@ -882,7 +802,7 @@ void ExtractUnderlines(NSAttributedString* string,
// cases, unless the key event generated any other command.
event.SetType(blink::WebInputEvent::kChar);
event.skip_in_browser = true;
localClient_->ForwardKeyboardEvent(event, latency_info);
clientHelper_->ForwardKeyboardEvent(event, latency_info);
}
}
......@@ -913,7 +833,7 @@ void ExtractUnderlines(NSAttributedString* string,
// History-swiping is not possible if the logic reaches this point.
WebMouseWheelEvent webEvent = WebMouseWheelEventBuilder::Build(event, self);
webEvent.rails_mode = mouseWheelFilter_.UpdateRailsMode(webEvent);
localClient_->ForwardWheelEvent(webEvent);
clientHelper_->ForwardWheelEvent(webEvent);
if (endWheelMonitor_) {
[NSEvent removeMonitor:endWheelMonitor_];
......@@ -927,7 +847,7 @@ void ExtractUnderlines(NSAttributedString* string,
WebGestureEvent gestureBeginEvent(WebGestureEventBuilder::Build(event, self));
localClient_->GestureBegin(gestureBeginEvent, isSyntheticallyInjected);
clientHelper_->GestureBegin(gestureBeginEvent, isSyntheticallyInjected);
}
- (void)handleEndGestureWithEvent:(NSEvent*)event {
......@@ -943,7 +863,7 @@ void ExtractUnderlines(NSAttributedString* string,
endEvent.SetSourceDevice(
blink::WebGestureDevice::kWebGestureDeviceTouchpad);
endEvent.SetNeedsWheelEvent(true);
localClient_->GestureEnd(endEvent);
clientHelper_->GestureEnd(endEvent);
}
}
......@@ -998,7 +918,7 @@ void ExtractUnderlines(NSAttributedString* string,
- (void)smartMagnifyWithEvent:(NSEvent*)event {
const WebGestureEvent& smartMagnifyEvent =
WebGestureEventBuilder::Build(event, self);
localClient_->SmartMagnify(smartMagnifyEvent);
clientHelper_->SmartMagnify(smartMagnifyEvent);
}
- (void)showLookUpDictionaryOverlayFromRange:(NSRange)range {
......@@ -1080,7 +1000,7 @@ void ExtractUnderlines(NSAttributedString* string,
// This is responsible for content scrolling!
WebMouseWheelEvent webEvent = WebMouseWheelEventBuilder::Build(event, self);
webEvent.rails_mode = mouseWheelFilter_.UpdateRailsMode(webEvent);
localClient_->RouteOrProcessWheelEvent(webEvent);
clientHelper_->RouteOrProcessWheelEvent(webEvent);
}
// Called repeatedly during a pinch gesture, with incremental change values.
......@@ -1113,7 +1033,7 @@ void ExtractUnderlines(NSAttributedString* string,
}
WebGestureEvent updateEvent = WebGestureEventBuilder::Build(event, self);
localClient_->GestureUpdate(updateEvent);
clientHelper_->GestureUpdate(updateEvent);
}
- (void)viewWillMoveToWindow:(NSWindow*)newWindow {
......@@ -1361,7 +1281,7 @@ void ExtractUnderlines(NSAttributedString* string,
- (id)accessibilityAttributeValue:(NSString*)attribute {
BrowserAccessibilityManager* manager =
localClient_->GetRootBrowserAccessibilityManager();
clientHelper_->GetRootBrowserAccessibilityManager();
// Contents specifies document view of RenderWidgetHostViewCocoa provided by
// BrowserAccessibilityManager. Children includes all subviews in addition to
......@@ -1387,7 +1307,7 @@ void ExtractUnderlines(NSAttributedString* string,
- (id)accessibilityHitTest:(NSPoint)point {
BrowserAccessibilityManager* manager =
localClient_->GetRootBrowserAccessibilityManager();
clientHelper_->GetRootBrowserAccessibilityManager();
if (!manager)
return self;
NSPoint pointInWindow =
......@@ -1402,13 +1322,13 @@ void ExtractUnderlines(NSAttributedString* string,
- (BOOL)accessibilityIsIgnored {
BrowserAccessibilityManager* manager =
localClient_->GetRootBrowserAccessibilityManager();
clientHelper_->GetRootBrowserAccessibilityManager();
return !manager;
}
- (NSUInteger)accessibilityGetIndexOf:(id)child {
BrowserAccessibilityManager* manager =
localClient_->GetRootBrowserAccessibilityManager();
clientHelper_->GetRootBrowserAccessibilityManager();
// Only child is root.
if (manager && ToBrowserAccessibilityCocoa(manager->GetRoot()) == child) {
return 0;
......@@ -1429,7 +1349,7 @@ void ExtractUnderlines(NSAttributedString* string,
return popup_focus_override;
BrowserAccessibilityManager* manager =
localClient_->GetRootBrowserAccessibilityManager();
clientHelper_->GetRootBrowserAccessibilityManager();
if (manager) {
BrowserAccessibility* focused_item = manager->GetFocus();
DCHECK(focused_item);
......@@ -1791,7 +1711,7 @@ extern NSString* NSTextInputReplacementRangeAttributeName;
WebMouseEvent event(WebInputEvent::kMouseUp, WebInputEvent::kNoModifiers,
ui::EventTimeForNow());
event.button = WebMouseEvent::Button::kLeft;
localClient_->ForwardMouseEvent(event);
clientHelper_->ForwardMouseEvent(event);
hasOpenMouseDown_ = NO;
}
}
......
......@@ -17,7 +17,7 @@
#include "components/viz/common/surfaces/surface_id.h"
#include "content/browser/renderer_host/browser_compositor_view_mac.h"
#include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h"
#include "content/browser/renderer_host/render_widget_host_ns_view_client.h"
#include "content/browser/renderer_host/render_widget_host_ns_view_client_helper.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/renderer_host/text_input_manager.h"
#include "content/common/content_export.h"
......@@ -65,7 +65,7 @@ class WebCursor;
// RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
class CONTENT_EXPORT RenderWidgetHostViewMac
: public RenderWidgetHostViewBase,
public RenderWidgetHostNSViewLocalClient,
public RenderWidgetHostNSViewClientHelper,
public mojom::RenderWidgetHostNSViewClient,
public BrowserCompositorMacClient,
public TextInputManager::Observer,
......@@ -300,7 +300,7 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// RenderWidgetHostImpl as well.
void UpdateNSViewAndDisplayProperties();
// RenderWidgetHostNSViewLocalClient implementation.
// RenderWidgetHostNSViewClientHelper implementation.
BrowserAccessibilityManager* GetRootBrowserAccessibilityManager() override;
void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event,
const ui::LatencyInfo& latency_info) override;
......
......@@ -1381,7 +1381,7 @@ MouseWheelPhaseHandler* RenderWidgetHostViewMac::GetMouseWheelPhaseHandler() {
}
///////////////////////////////////////////////////////////////////////////////
// RenderWidgetHostNSViewLocalClient and mojom::RenderWidgetHostNSViewClient
// RenderWidgetHostNSViewClientHelper and mojom::RenderWidgetHostNSViewClient
// implementation:
BrowserAccessibilityManager*
......@@ -1861,7 +1861,7 @@ void RenderWidgetHostViewMac::StopSpeaking() {
///////////////////////////////////////////////////////////////////////////////
// mojom::RenderWidgetHostNSViewClient functions that translate events and
// forward them to the RenderWidgetHostNSViewLocalClient implementation:
// forward them to the RenderWidgetHostNSViewClientHelper implementation:
void RenderWidgetHostViewMac::ForwardKeyboardEvent(
std::unique_ptr<InputEvent> input_event,
......
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