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

Unified Diff: ui/views/cocoa/bridged_native_widget.h

Issue 329463002: MacViews: Implement text input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to master 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_native_widget.h
diff --git a/ui/views/cocoa/bridged_native_widget.h b/ui/views/cocoa/bridged_native_widget.h
index 3e21bbf9e83b7089065fa26fcf95f2551df5d513..64cf81d71129b0974eccf1e128be71d3f9d4fcd9 100644
--- a/ui/views/cocoa/bridged_native_widget.h
+++ b/ui/views/cocoa/bridged_native_widget.h
@@ -9,6 +9,7 @@
#import "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
+#import "ui/views/focus/focus_manager.h"
#include "ui/views/ime/input_method_delegate.h"
#include "ui/views/views_export.h"
#include "ui/views/widget/widget.h"
@@ -29,7 +30,8 @@ class View;
// A bridge to an NSWindow managed by an instance of NativeWidgetMac or
// DesktopNativeWidgetMac. Serves as a helper class to bridge requests from the
// NativeWidgetMac to the Cocoa window. Behaves a bit like an aura::Window.
-class VIEWS_EXPORT BridgedNativeWidget : public internal::InputMethodDelegate {
+class VIEWS_EXPORT BridgedNativeWidget : public internal::InputMethodDelegate,
+ public FocusChangeListener {
public:
// Creates one side of the bridge. |parent| must not be NULL.
explicit BridgedNativeWidget(NativeWidgetMac* parent);
@@ -39,6 +41,10 @@ class VIEWS_EXPORT BridgedNativeWidget : public internal::InputMethodDelegate {
void Init(base::scoped_nsobject<NSWindow> window,
const Widget::InitParams& params);
+ // Sets or clears the focus manager to use for tracking focused views.
+ // This does NOT take ownership of |focus_manager|.
+ void SetFocusManager(FocusManager* focus_manager);
+
// Set or clears the views::View bridged by the content view. This does NOT
// take ownership of |view|.
void SetRootView(views::View* view);
@@ -66,6 +72,13 @@ class VIEWS_EXPORT BridgedNativeWidget : public internal::InputMethodDelegate {
base::scoped_nsobject<ViewsNSWindowDelegate> window_delegate_;
base::scoped_nsobject<BridgedContentView> bridged_view_;
scoped_ptr<ui::InputMethod> input_method_;
+ FocusManager* focus_manager_; // Weak. Owned by our Widget.
+
+ // Overridden from FocusChangeListener:
+ virtual void OnWillChangeFocus(View* focused_before,
+ View* focused_now) OVERRIDE;
+ virtual void OnDidChangeFocus(View* focused_before,
+ View* focused_now) OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
};
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698