Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Side by Side Diff: ui/views/cocoa/bridged_native_widget.h

Issue 329743002: MacViews: Initial skeleton for implementing NativeWidgetMac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase to master now we have stats Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_
6 #define UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 #import "base/mac/scoped_nsobject.h"
11 #include "ui/views/views_export.h"
12
13 @class BridgedContentView;
14
15 namespace views {
16
17 class View;
18
19 // A bridge to an NSWindow managed by an instance of NativeWidgetMac or
20 // DesktopNativeWidgetMac. Serves as a helper class to bridge requests from the
21 // NativeWidgetMac to the Cocoa window. Behaves a bit like an aura::Window.
22 class VIEWS_EXPORT BridgedNativeWidget {
23 public:
24 BridgedNativeWidget();
25 ~BridgedNativeWidget();
26
27 // Initialize the bridge, "retains" ownership of |window|.
28 void Init(base::scoped_nsobject<NSWindow> window);
29
30 // Set or clears the views::View bridged by the content view. This does NOT
31 // take ownership of |view|.
32 void SetRootView(views::View* view);
33
34 BridgedContentView* ns_view() { return bridged_view_; }
35 NSWindow* ns_window() { return window_; }
36
37 private:
38 base::scoped_nsobject<NSWindow> window_;
39 base::scoped_nsobject<BridgedContentView> bridged_view_;
40
41 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
42 };
43
44 } // namespace views
45
46 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698