| 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 "chrome/browser/ui/constrained_window.h" | 10 #include "chrome/browser/ui/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 "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
| 14 | 14 |
| 15 class TabContents; | 15 class TabContents; |
| 16 typedef TabContents TabContentsWrapper; | |
| 17 | 16 |
| 18 namespace views { | 17 namespace views { |
| 19 namespace internal { | 18 namespace internal { |
| 20 class NativeWidgetDelegate; | 19 class NativeWidgetDelegate; |
| 21 } | 20 } |
| 22 class NativeWidget; | 21 class NativeWidget; |
| 23 class NonClientFrameView; | 22 class NonClientFrameView; |
| 24 class WidgetDelegate; | 23 class WidgetDelegate; |
| 25 } | 24 } |
| 26 | 25 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 52 /////////////////////////////////////////////////////////////////////////////// | 51 /////////////////////////////////////////////////////////////////////////////// |
| 53 // ConstrainedWindowViews | 52 // ConstrainedWindowViews |
| 54 // | 53 // |
| 55 // A ConstrainedWindow implementation that implements a Constrained Window as | 54 // A ConstrainedWindow implementation that implements a Constrained Window as |
| 56 // a child HWND with a custom window frame. | 55 // a child HWND with a custom window frame. |
| 57 // | 56 // |
| 58 class ConstrainedWindowViews : public views::Widget, | 57 class ConstrainedWindowViews : public views::Widget, |
| 59 public ConstrainedWindow, | 58 public ConstrainedWindow, |
| 60 public NativeConstrainedWindowDelegate { | 59 public NativeConstrainedWindowDelegate { |
| 61 public: | 60 public: |
| 62 ConstrainedWindowViews(TabContentsWrapper* wrapper, | 61 ConstrainedWindowViews(TabContents* tab_contents, |
| 63 views::WidgetDelegate* widget_delegate); | 62 views::WidgetDelegate* widget_delegate); |
| 64 virtual ~ConstrainedWindowViews(); | 63 virtual ~ConstrainedWindowViews(); |
| 65 | 64 |
| 66 // Returns the TabContentsWrapper that constrains this Constrained Window. | 65 // Returns the TabContents that constrains this Constrained Window. |
| 67 TabContentsWrapper* owner() const { return wrapper_; } | 66 TabContents* owner() const { return tab_contents_; } |
| 68 | 67 |
| 69 // Overridden from ConstrainedWindow: | 68 // Overridden from ConstrainedWindow: |
| 70 virtual void ShowConstrainedWindow() OVERRIDE; | 69 virtual void ShowConstrainedWindow() OVERRIDE; |
| 71 virtual void CloseConstrainedWindow() OVERRIDE; | 70 virtual void CloseConstrainedWindow() OVERRIDE; |
| 72 virtual void FocusConstrainedWindow() OVERRIDE; | 71 virtual void FocusConstrainedWindow() OVERRIDE; |
| 73 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; | 72 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; |
| 74 | 73 |
| 75 private: | 74 private: |
| 76 // Overridden from views::Widget: | 75 // Overridden from views::Widget: |
| 77 virtual views::NonClientFrameView* CreateNonClientFrameView() OVERRIDE; | 76 virtual views::NonClientFrameView* CreateNonClientFrameView() OVERRIDE; |
| 78 | 77 |
| 79 // Overridden from NativeConstrainedWindowDelegate: | 78 // Overridden from NativeConstrainedWindowDelegate: |
| 80 virtual void OnNativeConstrainedWindowDestroyed() OVERRIDE; | 79 virtual void OnNativeConstrainedWindowDestroyed() OVERRIDE; |
| 81 virtual void OnNativeConstrainedWindowMouseActivate() OVERRIDE; | 80 virtual void OnNativeConstrainedWindowMouseActivate() OVERRIDE; |
| 82 virtual views::internal::NativeWidgetDelegate* | 81 virtual views::internal::NativeWidgetDelegate* |
| 83 AsNativeWidgetDelegate() OVERRIDE; | 82 AsNativeWidgetDelegate() OVERRIDE; |
| 84 | 83 |
| 85 TabContentsWrapper* wrapper_; | 84 TabContents* tab_contents_; |
| 86 | 85 |
| 87 NativeConstrainedWindow* native_constrained_window_; | 86 NativeConstrainedWindow* native_constrained_window_; |
| 88 | 87 |
| 89 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowViews); | 88 DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowViews); |
| 90 }; | 89 }; |
| 91 | 90 |
| 92 #endif // CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_ | 91 #endif // CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_ |
| OLD | NEW |