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

Unified Diff: views/widget/widget_gtk.h

Issue 7015051: Re-land: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/widget/widget.cc ('k') | views/widget/widget_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget_gtk.h
===================================================================
--- views/widget/widget_gtk.h (revision 85284)
+++ views/widget/widget_gtk.h (working copy)
@@ -41,25 +41,13 @@
}
// Widget implementation for GTK.
-class WidgetGtk : public Widget,
- public NativeWidget,
+class WidgetGtk : public NativeWidget,
public ui::ActiveWindowWatcherX::Observer,
public internal::InputMethodDelegate {
public:
- WidgetGtk();
+ explicit WidgetGtk(internal::NativeWidgetDelegate* delegate);
virtual ~WidgetGtk();
- // Marks this window as transient to its parent. A window that is transient
- // to its parent results in the parent rendering active when the child is
- // active.
- // This must be invoked before Init. This is only used for types other than
- // TYPE_CHILD. The default is false.
- // See gtk_window_set_transient_for for details.
- void make_transient_to_parent() {
- DCHECK(!widget_);
- transient_to_parent_ = true;
- }
-
// Returns the transient parent. See make_transient_to_parent for details on
// what the transient parent is.
GtkWindow* GetTransientParent() const;
@@ -123,19 +111,6 @@
// Overridden from ui::ActiveWindowWatcherX::Observer.
virtual void ActiveWindowChanged(GdkWindow* active_window);
- // Overridden from Widget:
- virtual gfx::NativeView GetNativeView() const;
- virtual gfx::NativeWindow GetNativeWindow() const;
- virtual bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator);
- virtual Window* GetWindow();
- virtual const Window* GetWindow() const;
- virtual void ViewHierarchyChanged(bool is_add, View *parent,
- View *child);
- virtual void NotifyAccessibilityEvent(
- View* view,
- ui::AccessibilityTypes::Event event_type,
- bool send_native_event);
-
// Clears the focus on the native widget having the focus.
virtual void ClearNativeFocus();
@@ -168,16 +143,30 @@
// detached widget.
static void RegisterChildExposeHandler(GtkWidget* widget);
+ void set_focus_on_creation(bool focus_on_creation) {
+ focus_on_creation_ = focus_on_creation;
+ }
+
// Overridden from NativeWidget:
- virtual void InitNativeWidget(const InitParams& params) OVERRIDE;
+ virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE;
virtual Widget* GetWidget() OVERRIDE;
+ virtual const Widget* GetWidget() const OVERRIDE;
+ virtual gfx::NativeView GetNativeView() const OVERRIDE;
+ virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE;
+ virtual Window* GetContainingWindow() OVERRIDE;
+ virtual const Window* GetContainingWindow() const OVERRIDE;
+ virtual void ViewRemoved(View* view) OVERRIDE;
virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE;
virtual void* GetNativeWindowProperty(const char* name) OVERRIDE;
virtual TooltipManager* GetTooltipManager() const OVERRIDE;
virtual bool IsScreenReaderActive() const OVERRIDE;
+ virtual void SendNativeAccessibilityEvent(
+ View* view,
+ ui::AccessibilityTypes::Event event_type) OVERRIDE;
virtual void SetMouseCapture() OVERRIDE;
virtual void ReleaseMouseCapture() OVERRIDE;
virtual bool HasMouseCapture() const OVERRIDE;
+ virtual bool IsMouseButtonDown() const OVERRIDE;
virtual InputMethod* GetInputMethodNative() OVERRIDE;
virtual void ReplaceInputMethod(InputMethod* input_method) OVERRIDE;
virtual gfx::Rect GetWindowScreenBounds() const OVERRIDE;
@@ -268,16 +257,13 @@
class DropObserver;
friend class DropObserver;
- // Overridden from Widget
- virtual RootView* CreateRootView() OVERRIDE;
-
// Overridden from NativeWidget
virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
// Overridden from internal::InputMethodDelegate
virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE;
- void SetInitParams(const InitParams& params);
+ void SetInitParams(const Widget::InitParams& params);
// This is called only when the window is transparent.
CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnWindowPaint, GdkEventExpose*);
@@ -291,7 +277,7 @@
static Window* GetWindowImpl(GtkWidget* widget);
// Creates the GtkWidget.
- void CreateGtkWidget(const InitParams& params);
+ void CreateGtkWidget(const Widget::InitParams& params);
// Invoked from create widget to enable the various bits needed for a
// transparent background. This is only invoked if MakeTransparent has been
@@ -307,6 +293,7 @@
GdkEventExpose* event);
// A delegate implementation that handles events received here.
+ // See class documentation for Widget in widget.h for a note about ownership.
internal::NativeWidgetDelegate* delegate_;
// Our native views. If we're a window/popup, then widget_ is the window and
@@ -333,7 +320,7 @@
// The following factory is used to delay destruction.
ScopedRunnableMethodFactory<WidgetGtk> close_widget_factory_;
- // See description above setter.
+ // See class documentation for Widget in widget.h for a note about ownership.
bool delete_on_destroy_;
// See description above make_transparent for details.
@@ -385,6 +372,10 @@
// this to determine whether we should process the event.
bool has_focus_;
+ // Whether we should SetFocus() on a newly created window after
+ // Init(). Defaults to true.
+ bool focus_on_creation_;
+
// If true, the window stays on top of the screen. This is only used
// for types other than TYPE_CHILD.
bool always_on_top_;
« no previous file with comments | « views/widget/widget.cc ('k') | views/widget/widget_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698