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

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

Issue 1146873002: [MacViews] Enable dragging a window by its caption/draggable areas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ 5 #ifndef UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_
6 #define UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ 6 #define UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #import "ui/base/cocoa/tracking_area.h" 10 #import "ui/base/cocoa/tracking_area.h"
11 11
12 namespace ui { 12 namespace ui {
13 class TextInputClient; 13 class TextInputClient;
14 } 14 }
15 15
16 namespace views { 16 namespace views {
17 class View; 17 class View;
18 } 18 }
19 19
20 // The NSView that sits as the root contentView of the NSWindow, whilst it has 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 21 // a views::RootView present. Bridges requests from Cocoa to the hosted
22 // views::View. 22 // views::View.
23 @interface BridgedContentView 23 @interface BridgedContentView
24 : NSView<NSTextInputClient, NSUserInterfaceValidations> { 24 : NSView<NSTextInputClient, NSUserInterfaceValidations> {
tapted 2015/05/22 04:03:12 looks like you need to rebase - this is a ToolTipB
jackhou1 2015/05/25 04:50:19 Done.
25 @private 25 @private
26 // Weak. The hosted RootView, owned by hostedView_->GetWidget(). 26 // Weak. The hosted RootView, owned by hostedView_->GetWidget().
27 views::View* hostedView_; 27 views::View* hostedView_;
28 28
29 // Weak. If non-null the TextInputClient of the currently focused View in the 29 // Weak. If non-null the TextInputClient of the currently focused View in the
30 // hierarchy rooted at |hostedView_|. Owned by the focused View. 30 // hierarchy rooted at |hostedView_|. Owned by the focused View.
31 ui::TextInputClient* textInputClient_; 31 ui::TextInputClient* textInputClient_;
32 32
33 // A tracking area installed to enable mouseMoved events. 33 // A tracking area installed to enable mouseMoved events.
34 ui::ScopedCrTrackingArea trackingArea_; 34 ui::ScopedCrTrackingArea trackingArea_;
35 35
36 // Whether the view is reacting to a keyDown event on the view. 36 // Whether the view is reacting to a keyDown event on the view.
37 BOOL inKeyDown_; 37 BOOL inKeyDown_;
38
39 // Whether dragging on the view moves the window.
40 BOOL mouseDownCanMoveWindow_;
38 } 41 }
39 42
40 @property(readonly, nonatomic) views::View* hostedView; 43 @property(readonly, nonatomic) views::View* hostedView;
41 @property(assign, nonatomic) ui::TextInputClient* textInputClient; 44 @property(assign, nonatomic) ui::TextInputClient* textInputClient;
42 45
46 // This usually returns YES if the view is transparent. We want to control it
47 // so that BridgedNativeWidget can dynamically enable dragging of the window.
48 @property(assign, nonatomic) BOOL mouseDownCanMoveWindow;
49
43 // Initialize the NSView -> views::View bridge. |viewToHost| must be non-NULL. 50 // Initialize the NSView -> views::View bridge. |viewToHost| must be non-NULL.
44 - (id)initWithView:(views::View*)viewToHost; 51 - (id)initWithView:(views::View*)viewToHost;
45 52
46 // Clear the hosted view. For example, if it is about to be destroyed. 53 // Clear the hosted view. For example, if it is about to be destroyed.
47 - (void)clearView; 54 - (void)clearView;
48 55
49 // Process a mouse event captured while the widget had global mouse capture. 56 // Process a mouse event captured while the widget had global mouse capture.
50 - (void)processCapturedMouseEvent:(NSEvent*)theEvent; 57 - (void)processCapturedMouseEvent:(NSEvent*)theEvent;
51 58
52 @end 59 @end
53 60
54 #endif // UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ 61 #endif // UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698