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_CONSTRAINED_WINDOW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "content/browser/tab_contents/constrained_window.h" | 10 #include "content/browser/tab_contents/constrained_window.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
13 #include "views/widget/widget.h" | 13 #include "views/widget/widget.h" |
14 | 14 |
15 class TabContents; | 15 class TabContents; |
Avi (use Gerrit)
2011/09/29 18:30:36
forward decl still needed?
| |
16 class TabContentsWrapper; | |
16 | 17 |
17 namespace views { | 18 namespace views { |
18 namespace internal { | 19 namespace internal { |
19 class NativeWidgetDelegate; | 20 class NativeWidgetDelegate; |
20 } | 21 } |
21 class NativeWidget; | 22 class NativeWidget; |
22 class NonClientFrameView; | 23 class NonClientFrameView; |
23 class WidgetDelegate; | 24 class WidgetDelegate; |
24 } | 25 } |
25 | 26 |
(...skipping 25 matching lines...) Expand all Loading... | |
51 /////////////////////////////////////////////////////////////////////////////// | 52 /////////////////////////////////////////////////////////////////////////////// |
52 // ConstrainedWindowViews | 53 // ConstrainedWindowViews |
53 // | 54 // |
54 // A ConstrainedWindow implementation that implements a Constrained Window as | 55 // A ConstrainedWindow implementation that implements a Constrained Window as |
55 // a child HWND with a custom window frame. | 56 // a child HWND with a custom window frame. |
56 // | 57 // |
57 class ConstrainedWindowViews : public views::Widget, | 58 class ConstrainedWindowViews : public views::Widget, |
58 public ConstrainedWindow, | 59 public ConstrainedWindow, |
59 public NativeConstrainedWindowDelegate { | 60 public NativeConstrainedWindowDelegate { |
60 public: | 61 public: |
61 ConstrainedWindowViews(TabContents* owner, | 62 ConstrainedWindowViews(TabContentsWrapper* wrapper, |
62 views::WidgetDelegate* widget_delegate); | 63 views::WidgetDelegate* widget_delegate); |
63 virtual ~ConstrainedWindowViews(); | 64 virtual ~ConstrainedWindowViews(); |
64 | 65 |
65 // Returns the TabContents that constrains this Constrained Window. | 66 // Returns the TabContents that constrains this Constrained Window. |
Avi (use Gerrit)
2011/09/29 18:30:36
comment?
| |
66 TabContents* owner() const { return owner_; } | 67 TabContentsWrapper* owner() const { return wrapper_; } |
67 | 68 |
68 // Overridden from ConstrainedWindow: | 69 // Overridden from ConstrainedWindow: |
69 virtual void ShowConstrainedWindow() OVERRIDE; | 70 virtual void ShowConstrainedWindow() OVERRIDE; |
70 virtual void CloseConstrainedWindow() OVERRIDE; | 71 virtual void CloseConstrainedWindow() OVERRIDE; |
71 virtual void FocusConstrainedWindow() OVERRIDE; | 72 virtual void FocusConstrainedWindow() OVERRIDE; |
72 | 73 |
73 private: | 74 private: |
74 // Overridden from views::Widget: | 75 // Overridden from views::Widget: |
75 virtual views::NonClientFrameView* CreateNonClientFrameView() OVERRIDE; | 76 virtual views::NonClientFrameView* CreateNonClientFrameView() OVERRIDE; |
76 | 77 |
77 // Overridden from NativeConstrainedWindowDelegate: | 78 // Overridden from NativeConstrainedWindowDelegate: |
78 virtual void OnNativeConstrainedWindowDestroyed() OVERRIDE; | 79 virtual void OnNativeConstrainedWindowDestroyed() OVERRIDE; |
79 virtual void OnNativeConstrainedWindowMouseActivate() OVERRIDE; | 80 virtual void OnNativeConstrainedWindowMouseActivate() OVERRIDE; |
80 virtual views::internal::NativeWidgetDelegate* | 81 virtual views::internal::NativeWidgetDelegate* |
81 AsNativeWidgetDelegate() OVERRIDE; | 82 AsNativeWidgetDelegate() OVERRIDE; |
82 | 83 |
83 // The TabContents that owns and constrains this ConstrainedWindow. | 84 TabContentsWrapper* wrapper_; |
84 TabContents* owner_; | |
85 | 85 |
86 NativeConstrainedWindow* native_constrained_window_; | 86 NativeConstrainedWindow* native_constrained_window_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowViews); | 88 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowViews); |
89 }; | 89 }; |
90 | 90 |
91 #endif // CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_ | 91 #endif // CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_ |
OLD | NEW |