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

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

Issue 1259913003: MacViews: Implement Tab Dragging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150529-ViewsBrowser-DisableCertificateDialog
Patch Set: update comments, still a TODO Created 5 years, 4 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
« no previous file with comments | « ui/events/cocoa/events_mac.mm ('k') | ui/views/cocoa/bridged_content_view.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #import "ui/base/cocoa/tool_tip_base_view.h" 11 #import "ui/base/cocoa/tool_tip_base_view.h"
12 #import "ui/base/cocoa/tracking_area.h" 12 #import "ui/base/cocoa/tracking_area.h"
13 13
14 namespace ui { 14 namespace ui {
15 class TextInputClient; 15 class TextInputClient;
16 } 16 }
17 17
18 namespace views { 18 namespace views {
19
19 class View; 20 class View;
21
22 // User data supplied in kCGEventSourceUserData for an event that should be
23 // ignored.
24 enum { kIgnoreEventUserData = 1 };
25
20 } 26 }
21 27
28
22 // The NSView that sits as the root contentView of the NSWindow, whilst it has 29 // The NSView that sits as the root contentView of the NSWindow, whilst it has
23 // a views::RootView present. Bridges requests from Cocoa to the hosted 30 // a views::RootView present. Bridges requests from Cocoa to the hosted
24 // views::View. 31 // views::View.
25 @interface BridgedContentView 32 @interface BridgedContentView
26 : ToolTipBaseView<NSTextInputClient, NSUserInterfaceValidations> { 33 : ToolTipBaseView<NSTextInputClient, NSUserInterfaceValidations> {
27 @private 34 @private
28 // Weak. The hosted RootView, owned by hostedView_->GetWidget(). 35 // Weak. The hosted RootView, owned by hostedView_->GetWidget().
29 views::View* hostedView_; 36 views::View* hostedView_;
30 37
31 // Weak. If non-null the TextInputClient of the currently focused View in the 38 // Weak. If non-null the TextInputClient of the currently focused View in the
32 // hierarchy rooted at |hostedView_|. Owned by the focused View. 39 // hierarchy rooted at |hostedView_|. Owned by the focused View.
33 ui::TextInputClient* textInputClient_; 40 ui::TextInputClient* textInputClient_;
34 41
35 // A tracking area installed to enable mouseMoved events. 42 // A tracking area installed to enable mouseMoved events.
36 ui::ScopedCrTrackingArea cursorTrackingArea_; 43 ui::ScopedCrTrackingArea cursorTrackingArea_;
37 44
38 // Whether the view is reacting to a keyDown event on the view. 45 // Whether the view is reacting to a keyDown event on the view.
39 BOOL inKeyDown_; 46 BOOL inKeyDown_;
40 47
48 BOOL ignoreMouseEvents_;
49
41 // The last tooltip text, used to limit updates. 50 // The last tooltip text, used to limit updates.
42 base::string16 lastTooltipText_; 51 base::string16 lastTooltipText_;
43 52
44 // Whether dragging on the view moves the window. 53 // Whether dragging on the view moves the window.
45 BOOL mouseDownCanMoveWindow_; 54 BOOL mouseDownCanMoveWindow_;
46 } 55 }
47 56
48 @property(readonly, nonatomic) views::View* hostedView; 57 @property(readonly, nonatomic) views::View* hostedView;
49 @property(assign, nonatomic) ui::TextInputClient* textInputClient; 58 @property(assign, nonatomic) ui::TextInputClient* textInputClient;
59 @property(assign, nonatomic) BOOL ignoreMouseEvents;
50 60
51 // Extends an atomic, readonly property on NSView to make it assignable. 61 // Extends an atomic, readonly property on NSView to make it assignable.
52 // This usually returns YES if the view is transparent. We want to control it 62 // This usually returns YES if the view is transparent. We want to control it
53 // so that BridgedNativeWidget can dynamically enable dragging of the window. 63 // so that BridgedNativeWidget can dynamically enable dragging of the window.
54 @property(assign) BOOL mouseDownCanMoveWindow; 64 @property(assign) BOOL mouseDownCanMoveWindow;
55 65
56 // Initialize the NSView -> views::View bridge. |viewToHost| must be non-NULL. 66 // Initialize the NSView -> views::View bridge. |viewToHost| must be non-NULL.
57 - (id)initWithView:(views::View*)viewToHost; 67 - (id)initWithView:(views::View*)viewToHost;
58 68
59 // Clear the hosted view. For example, if it is about to be destroyed. 69 // Clear the hosted view. For example, if it is about to be destroyed.
60 - (void)clearView; 70 - (void)clearView;
61 71
62 // Process a mouse event captured while the widget had global mouse capture. 72 // Process a mouse event captured while the widget had global mouse capture.
63 - (void)processCapturedMouseEvent:(NSEvent*)theEvent; 73 - (void)processCapturedMouseEvent:(NSEvent*)theEvent;
64 74
65 // Mac's version of views::corewm::TooltipController::UpdateIfRequired(). 75 // Mac's version of views::corewm::TooltipController::UpdateIfRequired().
66 // Updates the tooltip on the ToolTipBaseView if the text needs to change. 76 // Updates the tooltip on the ToolTipBaseView if the text needs to change.
67 // |locationInContent| is the position from the top left of the window's 77 // |locationInContent| is the position from the top left of the window's
68 // contentRect (also this NSView's frame), as given by a ui::LocatedEvent. 78 // contentRect (also this NSView's frame), as given by a ui::LocatedEvent.
69 - (void)updateTooltipIfRequiredAt:(const gfx::Point&)locationInContent; 79 - (void)updateTooltipIfRequiredAt:(const gfx::Point&)locationInContent;
70 80
71 @end 81 @end
72 82
73 #endif // UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_ 83 #endif // UI_VIEWS_COCOA_BRIDGED_CONTENT_VIEW_H_
OLDNEW
« no previous file with comments | « ui/events/cocoa/events_mac.mm ('k') | ui/views/cocoa/bridged_content_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698