1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_
6 #define UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_
8 #import <Cocoa/Cocoa.h>
10 #import "ui/base/cocoa/tracking_area.h"
13 class TextInputClient
;
20 // The NSView that sits as the root contentView of the NSWindow, whilst it has
21 // a views::RootView present. Bridges requests from Cocoa to the hosted
23 @interface BridgedContentView
: NSView
<NSTextInputClient
> {
25 // Weak. The hosted RootView, owned by hostedView_->GetWidget().
26 views::View
* hostedView_
;
28 // Weak. If non-null the TextInputClient of the currently focused View in the
29 // hierarchy rooted at |hostedView_|. Owned by the focused View.
30 ui::TextInputClient
* textInputClient_
;
32 // A tracking area installed to enable mouseMoved events.
33 ui::ScopedCrTrackingArea trackingArea_
;
35 // Set to ignore window visibility in a subsequent call to drawRect:. Views
36 // does not expect hidden windows to paint. However, when showing a window,
37 // Cocoa first paints before updating visibility.
41 @
property(readonly
, nonatomic
) views::View
* hostedView
;
42 @
property(assign
, nonatomic
) ui::TextInputClient
* textInputClient
;
43 @
property(assign
, nonatomic
) BOOL willShow
;
45 // Initialize the NSView -> views::View bridge. |viewToHost| must be non-NULL.
46 - (id
)initWithView
:(views::View
*)viewToHost
;
48 // Clear the hosted view. For example, if it is about to be destroyed.
53 #endif // UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_