| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_TAB_CONTENTS_CONSTRAINED_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_CONSTRAINED_WINDOW_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_CONSTRAINED_WINDOW_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_CONSTRAINED_WINDOW_H_ |
| 7 | 7 |
| 8 #include "chrome/common/page_transition_types.h" | 8 #include "chrome/common/page_transition_types.h" |
| 9 #include "webkit/glue/window_open_disposition.h" | 9 #include "webkit/glue/window_open_disposition.h" |
| 10 | 10 |
| 11 class ConstrainedWindow; | 11 // The different platform specific subclasses use different delegates for their |
| 12 // dialogs. |
| 13 #if defined(OS_WIN) |
| 12 namespace views { | 14 namespace views { |
| 13 class View; | |
| 14 class WindowDelegate; | 15 class WindowDelegate; |
| 15 } | 16 } |
| 16 namespace gfx { | 17 typedef views::WindowDelegate ConstrainedWindowDelegate; |
| 17 class Point; | 18 #elif defined(OS_LINUX) |
| 18 class Rect; | 19 class ConstrainedWindowGtkDelegate; |
| 19 } | 20 typedef ConstrainedWindowGtkDelegate ConstrainedWindowDelegate; |
| 20 class GURL; | 21 #elif defined(OS_MACOSX) |
| 22 // TODO(port): Change this type when Mac gets ConstrainedWindows. It is here |
| 23 // only to make things compile. There is no user or consumer of this type. |
| 24 typedef void* ConstrainedWindowDelegate; |
| 25 #endif |
| 26 |
| 21 class TabContents; | 27 class TabContents; |
| 22 | 28 |
| 23 /////////////////////////////////////////////////////////////////////////////// | 29 /////////////////////////////////////////////////////////////////////////////// |
| 24 // ConstrainedWindow | 30 // ConstrainedWindow |
| 25 // | 31 // |
| 26 // This interface represents a window that is constrained to a TabContents' | 32 // This interface represents a window that is constrained to a TabContents' |
| 27 // bounds. | 33 // bounds. |
| 28 // | 34 // |
| 29 class ConstrainedWindow { | 35 class ConstrainedWindow { |
| 30 public: | 36 public: |
| 31 // Create a Constrained Window that contains a views::View subclass | 37 // Create a Constrained Window that contains a platform specific client |
| 32 // that provides the client area. Typical uses include the HTTP Basic Auth | 38 // area. Typical uses include the HTTP Basic Auth prompt. The caller must |
| 33 // prompt. The caller must provide an object implementing | 39 // provide a delegate to describe the content area and to respond to events. |
| 34 // views::WindowDelegate so that the Constrained Window can be properly | |
| 35 // configured. If |initial_bounds| is empty, the dialog will be centered | |
| 36 // within the constraining TabContents. | |
| 37 static ConstrainedWindow* CreateConstrainedDialog( | 40 static ConstrainedWindow* CreateConstrainedDialog( |
| 38 TabContents* owner, | 41 TabContents* owner, |
| 39 views::WindowDelegate* window_delegate); | 42 ConstrainedWindowDelegate* delegate); |
| 40 | 43 |
| 41 // Closes the Constrained Window. | 44 // Closes the Constrained Window. |
| 42 virtual void CloseConstrainedWindow() = 0; | 45 virtual void CloseConstrainedWindow() = 0; |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 #endif // #ifndef CHROME_TAB_CONTENTS_BROWSER_CONSTRAINED_WINDOW_H_ | 48 #endif // CHROME_BROWSER_TAB_CONTENTS_CONSTRAINED_WINDOW_H_ |
| OLD | NEW |