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

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

Issue 309483009: Remaining bits to get views_examples_with_content_exe to work on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase to master@r275900 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
12 @class BridgedContentView;
13
14 namespace views {
15
16 class View;
17
18 // A bridge to an NSWindow managed by an instance of NativeWidgetMac or
19 // DesktopNativeWidgetMac. Serves as a helper class to bridge requests from the
20 // NativeWidgetMac to the Cocoa window. Behaves a bit like an aura::Window.
21 class BridgedNativeWidget {
22 public:
23 BridgedNativeWidget();
24 ~BridgedNativeWidget();
25
26 // Initialize the bridge, "retains" ownership of |window|.
27 void Init(base::scoped_nsobject<NSWindow> window);
28
29 // Set or clears the views::View bridged by the content view. This does NOT
30 // take ownership of |view|.
31 void SetRootView(views::View* view);
32
33 BridgedContentView* ns_view() { return bridged_view_; }
34 NSWindow* ns_window() { return window_; }
35
36 private:
37 base::scoped_nsobject<NSWindow> window_;
38 base::scoped_nsobject<BridgedContentView> bridged_view_;
39
40 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
41 };
42
43 } // namespace views
44
45 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698