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 TabContentsViewTouch; | 20 class TabContentsViewTouch; |
| 21 #elif defined(TOOLKIT_VIEWS) |
| 22 class NativeTabContentsViewGtk; |
21 #else | 23 #else |
22 class TabContentsViewGtk; | 24 class TabContentsViewGtk; |
23 #endif | 25 #endif |
24 | 26 |
25 class ConstrainedWindowGtkDelegate { | 27 class ConstrainedWindowGtkDelegate { |
26 public: | 28 public: |
27 // Returns the widget that will be put in the constrained window's container. | 29 // Returns the widget that will be put in the constrained window's container. |
28 virtual GtkWidget* GetWidgetRoot() = 0; | 30 virtual GtkWidget* GetWidgetRoot() = 0; |
29 | 31 |
30 // Returns the widget that should get focus when ConstrainedWindow is focused. | 32 // Returns the widget that should get focus when ConstrainedWindow is focused. |
(...skipping 12 matching lines...) Expand all Loading... |
43 virtual ~ConstrainedWindowGtkDelegate(); | 45 virtual ~ConstrainedWindowGtkDelegate(); |
44 }; | 46 }; |
45 | 47 |
46 // Constrained window implementation for the GTK port. Unlike the Win32 system, | 48 // Constrained window implementation for the GTK port. Unlike the Win32 system, |
47 // ConstrainedWindowGtk doesn't draw draggable fake windows and instead just | 49 // ConstrainedWindowGtk doesn't draw draggable fake windows and instead just |
48 // centers the dialog. It is thus an order of magnitude simpler. | 50 // centers the dialog. It is thus an order of magnitude simpler. |
49 class ConstrainedWindowGtk : public ConstrainedWindow { | 51 class ConstrainedWindowGtk : public ConstrainedWindow { |
50 public: | 52 public: |
51 #if defined(TOUCH_UI) | 53 #if defined(TOUCH_UI) |
52 typedef TabContentsViewTouch TabContentsViewType; | 54 typedef TabContentsViewTouch TabContentsViewType; |
| 55 #elif defined(TOOLKIT_VIEWS) |
| 56 typedef NativeTabContentsViewGtk TabContentsViewType; |
53 #else | 57 #else |
54 typedef TabContentsViewGtk TabContentsViewType; | 58 typedef TabContentsViewGtk TabContentsViewType; |
55 #endif | 59 #endif |
56 | 60 |
57 virtual ~ConstrainedWindowGtk(); | 61 virtual ~ConstrainedWindowGtk(); |
58 | 62 |
59 // Overridden from ConstrainedWindow: | 63 // Overridden from ConstrainedWindow: |
60 virtual void ShowConstrainedWindow(); | 64 virtual void ShowConstrainedWindow(); |
61 virtual void CloseConstrainedWindow(); | 65 virtual void CloseConstrainedWindow(); |
62 virtual void FocusConstrainedWindow(); | 66 virtual void FocusConstrainedWindow(); |
(...skipping 30 matching lines...) Expand all Loading... |
93 | 97 |
94 // Stores if |ShowConstrainedWindow()| has been called. | 98 // Stores if |ShowConstrainedWindow()| has been called. |
95 bool visible_; | 99 bool visible_; |
96 | 100 |
97 ScopedRunnableMethodFactory<ConstrainedWindowGtk> factory_; | 101 ScopedRunnableMethodFactory<ConstrainedWindowGtk> factory_; |
98 | 102 |
99 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowGtk); | 103 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowGtk); |
100 }; | 104 }; |
101 | 105 |
102 #endif // CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_ | 106 #endif // CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_ |
OLD | NEW |