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

Side by Side Diff: chrome/browser/ui/gtk/constrained_window_gtk.h

Issue 7880003: content: Move constrained window code from TabContents to TabContentsWrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Attempt to fix views merge part 2 Created 9 years, 2 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_
7 #pragma once 7 #pragma once
8 8
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/task.h" 12 #include "base/task.h"
13 #include "content/browser/tab_contents/constrained_window.h" 13 #include "content/browser/tab_contents/constrained_window.h"
14 #include "ui/base/gtk/gtk_signal.h" 14 #include "ui/base/gtk/gtk_signal.h"
15 #include "ui/base/gtk/owned_widget_gtk.h" 15 #include "ui/base/gtk/owned_widget_gtk.h"
16 16
17 class TabContents; 17 class TabContentsWrapper;
18 typedef struct _GdkColor GdkColor; 18 typedef struct _GdkColor GdkColor;
19 #if defined(TOUCH_UI) 19 #if defined(TOUCH_UI)
20 class TabContentsViewViews; 20 class TabContentsViewViews;
21 #elif defined(TOOLKIT_VIEWS) 21 #elif defined(TOOLKIT_VIEWS)
22 class NativeTabContentsViewGtk; 22 class NativeTabContentsViewGtk;
23 #else 23 #else
24 class TabContentsViewGtk; 24 class TabContentsViewGtk;
25 #endif 25 #endif
26 26
27 class ConstrainedWindowGtkDelegate { 27 class ConstrainedWindowGtkDelegate {
(...skipping 23 matching lines...) Expand all
51 class ConstrainedWindowGtk : public ConstrainedWindow { 51 class ConstrainedWindowGtk : public ConstrainedWindow {
52 public: 52 public:
53 #if defined(TOUCH_UI) 53 #if defined(TOUCH_UI)
54 typedef TabContentsViewViews TabContentsViewType; 54 typedef TabContentsViewViews TabContentsViewType;
55 #elif defined(TOOLKIT_VIEWS) 55 #elif defined(TOOLKIT_VIEWS)
56 typedef NativeTabContentsViewGtk TabContentsViewType; 56 typedef NativeTabContentsViewGtk TabContentsViewType;
57 #else 57 #else
58 typedef TabContentsViewGtk TabContentsViewType; 58 typedef TabContentsViewGtk TabContentsViewType;
59 #endif 59 #endif
60 60
61 ConstrainedWindowGtk(TabContents* owner, 61 ConstrainedWindowGtk(TabContentsWrapper* wrapper,
62 ConstrainedWindowGtkDelegate* delegate); 62 ConstrainedWindowGtkDelegate* delegate);
63 virtual ~ConstrainedWindowGtk(); 63 virtual ~ConstrainedWindowGtk();
64 64
65 // Overridden from ConstrainedWindow: 65 // Overridden from ConstrainedWindow:
66 virtual void ShowConstrainedWindow(); 66 virtual void ShowConstrainedWindow();
67 virtual void CloseConstrainedWindow(); 67 virtual void CloseConstrainedWindow();
68 virtual void FocusConstrainedWindow(); 68 virtual void FocusConstrainedWindow();
69 69
70 // Returns the TabContents that constrains this Constrained Window. 70 // Returns the TabContents that constrains this Constrained Window.
Avi (use Gerrit) 2011/09/29 18:30:36 comment?
71 TabContents* owner() const { return owner_; } 71 TabContentsWrapper* owner() const { return wrapper_; }
72 72
73 // Returns the toplevel widget that displays this "window". 73 // Returns the toplevel widget that displays this "window".
74 GtkWidget* widget() { return border_.get(); } 74 GtkWidget* widget() { return border_.get(); }
75 75
76 // Returns the View that we collaborate with to position ourselves. 76 // Returns the View that we collaborate with to position ourselves.
77 TabContentsViewType* ContainingView(); 77 TabContentsViewType* ContainingView();
78 78
79 private: 79 private:
80 friend class ConstrainedWindow; 80 friend class ConstrainedWindow;
81 81
82 // Signal callbacks. 82 // Signal callbacks.
83 CHROMEGTK_CALLBACK_1(ConstrainedWindowGtk, gboolean, OnKeyPress, 83 CHROMEGTK_CALLBACK_1(ConstrainedWindowGtk, gboolean, OnKeyPress,
84 GdkEventKey*); 84 GdkEventKey*);
85 CHROMEGTK_CALLBACK_1(ConstrainedWindowGtk, void, OnHierarchyChanged, 85 CHROMEGTK_CALLBACK_1(ConstrainedWindowGtk, void, OnHierarchyChanged,
86 GtkWidget*); 86 GtkWidget*);
87 87
88 // The TabContents that owns and constrains this ConstrainedWindow. 88 // The TabContents that owns and constrains this ConstrainedWindow.
Avi (use Gerrit) 2011/09/29 18:30:36 comment?
89 TabContents* owner_; 89 TabContentsWrapper* wrapper_;
90 90
91 // The top level widget container that exports to our TabContentsView. 91 // The top level widget container that exports to our TabContentsView.
92 ui::OwnedWidgetGtk border_; 92 ui::OwnedWidgetGtk border_;
93 93
94 // Delegate that provides the contents of this constrained window. 94 // Delegate that provides the contents of this constrained window.
95 ConstrainedWindowGtkDelegate* delegate_; 95 ConstrainedWindowGtkDelegate* delegate_;
96 96
97 // Stores if |ShowConstrainedWindow()| has been called. 97 // Stores if |ShowConstrainedWindow()| has been called.
98 bool visible_; 98 bool visible_;
99 99
100 ScopedRunnableMethodFactory<ConstrainedWindowGtk> factory_; 100 ScopedRunnableMethodFactory<ConstrainedWindowGtk> factory_;
101 101
102 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowGtk); 102 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowGtk);
103 }; 103 };
104 104
105 #endif // CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_ 105 #endif // CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698