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_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_VIEWS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/timer.h" | 10 #include "base/timer.h" |
11 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" | 11 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
12 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" | 12 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" |
13 #include "content/browser/tab_contents/tab_contents_view.h" | 13 #include "content/browser/tab_contents/tab_contents_view.h" |
14 #include "views/widget/widget.h" | 14 #include "views/widget/widget.h" |
15 | 15 |
16 class ConstrainedWindowGtk; | 16 class ConstrainedWindowGtk; |
17 class NativeTabContentsView; | 17 class NativeTabContentsView; |
18 class RenderViewContextMenuViews; | 18 class RenderViewContextMenuViews; |
19 class SadTabView; | |
20 class SkBitmap; | 19 class SkBitmap; |
21 struct WebDropData; | 20 struct WebDropData; |
22 namespace gfx { | 21 namespace gfx { |
23 class Point; | 22 class Point; |
24 class Size; | 23 class Size; |
25 } | 24 } |
26 namespace views { | 25 namespace views { |
27 class Widget; | 26 class Widget; |
28 } | 27 } |
29 | 28 |
30 // Views-specific implementation of the TabContentsView. | 29 // Views-specific implementation of the TabContentsView. |
31 // TODO(beng): Remove last remnants of Windows-specificity, and make this | |
32 // subclass Widget. | |
33 class TabContentsViewViews : public views::Widget, | 30 class TabContentsViewViews : public views::Widget, |
34 public TabContentsView, | 31 public TabContentsView, |
35 public internal::NativeTabContentsViewDelegate { | 32 public internal::NativeTabContentsViewDelegate { |
36 public: | 33 public: |
37 // The corresponding TabContents is passed in the constructor, and manages our | 34 // The corresponding TabContents is passed in the constructor, and manages our |
38 // lifetime. This doesn't need to be the case, but is this way currently | 35 // lifetime. This doesn't need to be the case, but is this way currently |
39 // because that's what was easiest when they were split. | 36 // because that's what was easiest when they were split. |
40 explicit TabContentsViewViews(TabContents* tab_contents); | 37 explicit TabContentsViewViews(TabContents* tab_contents); |
41 virtual ~TabContentsViewViews(); | 38 virtual ~TabContentsViewViews(); |
42 | 39 |
(...skipping 25 matching lines...) Expand all Loading... |
68 virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; | 65 virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; |
69 virtual void Focus() OVERRIDE; | 66 virtual void Focus() OVERRIDE; |
70 virtual void SetInitialFocus() OVERRIDE; | 67 virtual void SetInitialFocus() OVERRIDE; |
71 virtual void StoreFocus() OVERRIDE; | 68 virtual void StoreFocus() OVERRIDE; |
72 virtual void RestoreFocus() OVERRIDE; | 69 virtual void RestoreFocus() OVERRIDE; |
73 virtual bool IsDoingDrag() const OVERRIDE; | 70 virtual bool IsDoingDrag() const OVERRIDE; |
74 virtual void CancelDragAndCloseTab() OVERRIDE; | 71 virtual void CancelDragAndCloseTab() OVERRIDE; |
75 virtual bool IsEventTracking() const; | 72 virtual bool IsEventTracking() const; |
76 virtual void CloseTabAfterEventTracking(); | 73 virtual void CloseTabAfterEventTracking(); |
77 virtual void GetViewBounds(gfx::Rect* out) const OVERRIDE; | 74 virtual void GetViewBounds(gfx::Rect* out) const OVERRIDE; |
| 75 virtual void InstallOverlayView(gfx::NativeView view) OVERRIDE; |
| 76 virtual void RemoveOverlayView() OVERRIDE; |
78 | 77 |
79 // Implementation of RenderViewHostDelegate::View. | 78 // Implementation of RenderViewHostDelegate::View. |
80 virtual void CreateNewWindow( | 79 virtual void CreateNewWindow( |
81 int route_id, | 80 int route_id, |
82 const ViewHostMsg_CreateWindow_Params& params) OVERRIDE; | 81 const ViewHostMsg_CreateWindow_Params& params) OVERRIDE; |
83 virtual void CreateNewWidget(int route_id, | 82 virtual void CreateNewWidget(int route_id, |
84 WebKit::WebPopupType popup_type) OVERRIDE; | 83 WebKit::WebPopupType popup_type) OVERRIDE; |
85 virtual void CreateNewFullscreenWidget(int route_id) OVERRIDE; | 84 virtual void CreateNewFullscreenWidget(int route_id) OVERRIDE; |
86 virtual void ShowCreatedWindow(int route_id, | 85 virtual void ShowCreatedWindow(int route_id, |
87 WindowOpenDisposition disposition, | 86 WindowOpenDisposition disposition, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // --------------------------------------------------------------------------- | 144 // --------------------------------------------------------------------------- |
146 | 145 |
147 // The TabContents whose contents we display. | 146 // The TabContents whose contents we display. |
148 TabContents* tab_contents_; | 147 TabContents* tab_contents_; |
149 | 148 |
150 // Common implementations of some RenderViewHostDelegate::View methods. | 149 // Common implementations of some RenderViewHostDelegate::View methods. |
151 RenderViewHostDelegateViewHelper delegate_view_helper_; | 150 RenderViewHostDelegateViewHelper delegate_view_helper_; |
152 | 151 |
153 NativeTabContentsView* native_tab_contents_view_; | 152 NativeTabContentsView* native_tab_contents_view_; |
154 | 153 |
155 // If non-null we're showing a sad tab. SadTabView is hosted in a separate | |
156 // widget so that TabContentsViewViews does not need to draw, and can be | |
157 // created without a texture. | |
158 views::Widget* sad_tab_widget_; | |
159 | |
160 // The id used in the ViewStorage to store the last focused view. | 154 // The id used in the ViewStorage to store the last focused view. |
161 int last_focused_view_storage_id_; | 155 int last_focused_view_storage_id_; |
162 | 156 |
163 // The context menu. Callbacks are asynchronous so we need to keep it around. | 157 // The context menu. Callbacks are asynchronous so we need to keep it around. |
164 scoped_ptr<RenderViewContextMenuViews> context_menu_; | 158 scoped_ptr<RenderViewContextMenuViews> context_menu_; |
165 | 159 |
166 // Set to true if we want to close the tab after the system drag operation | 160 // Set to true if we want to close the tab after the system drag operation |
167 // has finished. | 161 // has finished. |
168 bool close_tab_after_drag_ends_; | 162 bool close_tab_after_drag_ends_; |
169 | 163 |
170 // Used to close the tab after the stack has unwound. | 164 // Used to close the tab after the stack has unwound. |
171 base::OneShotTimer<TabContentsViewViews> close_tab_timer_; | 165 base::OneShotTimer<TabContentsViewViews> close_tab_timer_; |
172 | 166 |
173 // The FocusManager associated with this tab. Stored as it is not directly | 167 // The FocusManager associated with this tab. Stored as it is not directly |
174 // accessible when un-parented. | 168 // accessible when un-parented. |
175 mutable const views::FocusManager* focus_manager_; | 169 mutable const views::FocusManager* focus_manager_; |
176 | 170 |
| 171 // The overlaid view. Owned by the caller of |InstallOverlayView|; this is a |
| 172 // weak reference. |
| 173 views::Widget* overlaid_view_; |
| 174 |
177 DISALLOW_COPY_AND_ASSIGN(TabContentsViewViews); | 175 DISALLOW_COPY_AND_ASSIGN(TabContentsViewViews); |
178 }; | 176 }; |
179 | 177 |
180 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_VIEWS_H_ | 178 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_TAB_CONTENTS_VIEW_VIEWS_H_ |
OLD | NEW |