| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 // TODO(jam): remove this file when all files have been converted. |
| 10 | 10 #include "content/browser/tab_contents/constrained_window.h" |
| 11 // The different platform specific subclasses use different delegates for their | |
| 12 // dialogs. | |
| 13 #if defined(OS_WIN) | |
| 14 namespace views { | |
| 15 class WindowDelegate; | |
| 16 class DialogDelegate; | |
| 17 } | |
| 18 typedef views::WindowDelegate ConstrainedWindowDelegate; | |
| 19 typedef views::DialogDelegate ConstrainedDialogDelegate; | |
| 20 #elif defined(OS_MACOSX) | |
| 21 class ConstrainedWindowMacDelegate; | |
| 22 class ConstrainedWindowMacDelegateSystemSheet; | |
| 23 typedef ConstrainedWindowMacDelegate ConstrainedWindowDelegate; | |
| 24 typedef ConstrainedWindowMacDelegateSystemSheet ConstrainedDialogDelegate; | |
| 25 #elif defined(TOOLKIT_USES_GTK) | |
| 26 class ConstrainedWindowGtkDelegate; | |
| 27 typedef ConstrainedWindowGtkDelegate ConstrainedWindowDelegate; | |
| 28 typedef ConstrainedWindowGtkDelegate ConstrainedDialogDelegate; | |
| 29 #endif | |
| 30 | |
| 31 class TabContents; | |
| 32 | |
| 33 /////////////////////////////////////////////////////////////////////////////// | |
| 34 // ConstrainedWindow | |
| 35 // | |
| 36 // This interface represents a window that is constrained to a TabContents' | |
| 37 // bounds. | |
| 38 // | |
| 39 class ConstrainedWindow { | |
| 40 public: | |
| 41 // Create a Constrained Window that contains a platform specific client | |
| 42 // area. Typical uses include the HTTP Basic Auth prompt. The caller must | |
| 43 // provide a delegate to describe the content area and to respond to events. | |
| 44 static ConstrainedWindow* CreateConstrainedDialog( | |
| 45 TabContents* owner, | |
| 46 ConstrainedWindowDelegate* delegate); | |
| 47 | |
| 48 // Makes the Constrained Window visible. Only one Constrained Window is shown | |
| 49 // at a time per tab. | |
| 50 virtual void ShowConstrainedWindow() = 0; | |
| 51 | |
| 52 // Closes the Constrained Window. | |
| 53 virtual void CloseConstrainedWindow() = 0; | |
| 54 | |
| 55 // Sets focus on the Constrained Window. | |
| 56 virtual void FocusConstrainedWindow() {} | |
| 57 | |
| 58 protected: | |
| 59 virtual ~ConstrainedWindow() {} | |
| 60 }; | |
| 61 | 11 |
| 62 #endif // CHROME_BROWSER_TAB_CONTENTS_CONSTRAINED_WINDOW_H_ | 12 #endif // CHROME_BROWSER_TAB_CONTENTS_CONSTRAINED_WINDOW_H_ |
| OLD | NEW |