OLD | NEW |
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 "chrome/browser/ui/gtk/owned_widget_gtk.h" | 13 #include "chrome/browser/ui/gtk/owned_widget_gtk.h" |
14 #include "content/browser/tab_contents/constrained_window.h" | 14 #include "content/browser/tab_contents/constrained_window.h" |
15 #include "ui/base/gtk/gtk_signal.h" | 15 #include "ui/base/gtk/gtk_signal.h" |
16 | 16 |
17 class TabContents; | 17 class TabContents; |
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 #else | 21 #else |
22 class TabContentsViewGtk; | 22 class TabContentsViewGtk; |
23 #endif | 23 #endif |
24 | 24 |
| 25 namespace gfx { |
| 26 class Insets; |
| 27 } |
| 28 |
25 class ConstrainedWindowGtkDelegate { | 29 class ConstrainedWindowGtkDelegate { |
26 public: | 30 public: |
27 // Returns the widget that will be put in the constrained window's container. | 31 // Returns the widget that will be put in the constrained window's container. |
28 virtual GtkWidget* GetWidgetRoot() = 0; | 32 virtual GtkWidget* GetWidgetRoot() = 0; |
29 | 33 |
30 // Returns the widget that should get focus when ConstrainedWindow is focused. | 34 // Returns the widget that should get focus when ConstrainedWindow is focused. |
31 virtual GtkWidget* GetFocusWidget() = 0; | 35 virtual GtkWidget* GetFocusWidget() = 0; |
32 | 36 |
33 // Tells the delegate to either delete itself or set up a task to delete | 37 // Tells the delegate to either delete itself or set up a task to delete |
34 // itself later. | 38 // itself later. |
35 virtual void DeleteDelegate() = 0; | 39 virtual void DeleteDelegate() = 0; |
36 | 40 |
37 virtual bool GetBackgroundColor(GdkColor* color); | 41 virtual bool GetBackgroundColor(GdkColor* color); |
38 | 42 |
| 43 virtual gfx::Insets GetInsets() const; |
| 44 |
39 protected: | 45 protected: |
40 virtual ~ConstrainedWindowGtkDelegate(); | 46 virtual ~ConstrainedWindowGtkDelegate(); |
41 }; | 47 }; |
42 | 48 |
43 // Constrained window implementation for the GTK port. Unlike the Win32 system, | 49 // Constrained window implementation for the GTK port. Unlike the Win32 system, |
44 // ConstrainedWindowGtk doesn't draw draggable fake windows and instead just | 50 // ConstrainedWindowGtk doesn't draw draggable fake windows and instead just |
45 // centers the dialog. It is thus an order of magnitude simpler. | 51 // centers the dialog. It is thus an order of magnitude simpler. |
46 class ConstrainedWindowGtk : public ConstrainedWindow { | 52 class ConstrainedWindowGtk : public ConstrainedWindow { |
47 public: | 53 public: |
48 #if defined(TOUCH_UI) | 54 #if defined(TOUCH_UI) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 96 |
91 // Stores if |ShowConstrainedWindow()| has been called. | 97 // Stores if |ShowConstrainedWindow()| has been called. |
92 bool visible_; | 98 bool visible_; |
93 | 99 |
94 ScopedRunnableMethodFactory<ConstrainedWindowGtk> factory_; | 100 ScopedRunnableMethodFactory<ConstrainedWindowGtk> factory_; |
95 | 101 |
96 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowGtk); | 102 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowGtk); |
97 }; | 103 }; |
98 | 104 |
99 #endif // CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_ | 105 #endif // CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_ |
OLD | NEW |