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/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/task.h" | 13 #include "base/task.h" |
14 #include "chrome/browser/ui/constrained_window.h" | 14 #include "chrome/browser/ui/constrained_window.h" |
15 #include "ui/base/gtk/gtk_signal.h" | 15 #include "ui/base/gtk/gtk_signal.h" |
16 #include "ui/base/gtk/owned_widget_gtk.h" | 16 #include "ui/base/gtk/owned_widget_gtk.h" |
17 | 17 |
18 class TabContentsWrapper; | 18 class TabContentsWrapper; |
19 typedef struct _GdkColor GdkColor; | 19 typedef struct _GdkColor GdkColor; |
20 #if defined(TOUCH_UI) | 20 #if defined(TOOLKIT_VIEWS) |
21 class TabContentsViewViews; | |
22 #elif defined(TOOLKIT_VIEWS) | |
23 class NativeTabContentsViewGtk; | 21 class NativeTabContentsViewGtk; |
24 #else | 22 #else |
25 class ChromeTabContentsViewWrapperGtk; | 23 class ChromeTabContentsViewWrapperGtk; |
26 #endif | 24 #endif |
27 | 25 |
28 class ConstrainedWindowGtkDelegate { | 26 class ConstrainedWindowGtkDelegate { |
29 public: | 27 public: |
30 // Returns the widget that will be put in the constrained window's container. | 28 // Returns the widget that will be put in the constrained window's container. |
31 virtual GtkWidget* GetWidgetRoot() = 0; | 29 virtual GtkWidget* GetWidgetRoot() = 0; |
32 | 30 |
(...skipping 11 matching lines...) Expand all Loading... |
44 | 42 |
45 protected: | 43 protected: |
46 virtual ~ConstrainedWindowGtkDelegate(); | 44 virtual ~ConstrainedWindowGtkDelegate(); |
47 }; | 45 }; |
48 | 46 |
49 // Constrained window implementation for the GTK port. Unlike the Win32 system, | 47 // Constrained window implementation for the GTK port. Unlike the Win32 system, |
50 // ConstrainedWindowGtk doesn't draw draggable fake windows and instead just | 48 // ConstrainedWindowGtk doesn't draw draggable fake windows and instead just |
51 // centers the dialog. It is thus an order of magnitude simpler. | 49 // centers the dialog. It is thus an order of magnitude simpler. |
52 class ConstrainedWindowGtk : public ConstrainedWindow { | 50 class ConstrainedWindowGtk : public ConstrainedWindow { |
53 public: | 51 public: |
54 #if defined(TOUCH_UI) | 52 #if defined(TOOLKIT_VIEWS) |
55 typedef TabContentsViewViews TabContentsViewType; | |
56 #elif defined(TOOLKIT_VIEWS) | |
57 typedef NativeTabContentsViewGtk TabContentsViewType; | 53 typedef NativeTabContentsViewGtk TabContentsViewType; |
58 #else | 54 #else |
59 typedef ChromeTabContentsViewWrapperGtk TabContentsViewType; | 55 typedef ChromeTabContentsViewWrapperGtk TabContentsViewType; |
60 #endif | 56 #endif |
61 | 57 |
62 ConstrainedWindowGtk(TabContentsWrapper* wrapper, | 58 ConstrainedWindowGtk(TabContentsWrapper* wrapper, |
63 ConstrainedWindowGtkDelegate* delegate); | 59 ConstrainedWindowGtkDelegate* delegate); |
64 virtual ~ConstrainedWindowGtk(); | 60 virtual ~ConstrainedWindowGtk(); |
65 | 61 |
66 // Overridden from ConstrainedWindow: | 62 // Overridden from ConstrainedWindow: |
(...skipping 30 matching lines...) Expand all Loading... |
97 | 93 |
98 // Stores if |ShowConstrainedWindow()| has been called. | 94 // Stores if |ShowConstrainedWindow()| has been called. |
99 bool visible_; | 95 bool visible_; |
100 | 96 |
101 base::WeakPtrFactory<ConstrainedWindowGtk> weak_factory_; | 97 base::WeakPtrFactory<ConstrainedWindowGtk> weak_factory_; |
102 | 98 |
103 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowGtk); | 99 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowGtk); |
104 }; | 100 }; |
105 | 101 |
106 #endif // CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_ | 102 #endif // CHROME_BROWSER_UI_GTK_CONSTRAINED_WINDOW_GTK_H_ |
OLD | NEW |