| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_DIALOGS_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ipc/ipc_message.h" | 9 #include "ipc/ipc_message.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 | 11 |
| 12 class Browser; | 12 class Browser; |
| 13 class Profile; | 13 class Profile; |
| 14 class SkBitmap; | 14 class SkBitmap; |
| 15 class TabContentsWrapper; | 15 class TabContentsWrapper; |
| 16 class TabModalConfirmDialogDelegate; | 16 class TabModalConfirmDialogDelegate; |
| 17 class TemplateURL; | 17 class TemplateURL; |
| 18 class WebDialogDelegate; | |
| 19 | 18 |
| 20 namespace content { | 19 namespace content { |
| 21 class WebContents; | 20 class WebContents; |
| 22 } | 21 } |
| 23 | 22 |
| 24 namespace extensions { | 23 namespace extensions { |
| 25 class Extension; | 24 class Extension; |
| 26 } | 25 } |
| 27 | 26 |
| 27 namespace ui { |
| 28 class WebDialogDelegate; |
| 29 } |
| 30 |
| 28 namespace browser { | 31 namespace browser { |
| 29 | 32 |
| 30 #if defined(IPC_MESSAGE_LOG_ENABLED) | 33 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 31 | 34 |
| 32 // The dialog is a singleton. If the dialog is already opened, it won't do | 35 // The dialog is a singleton. If the dialog is already opened, it won't do |
| 33 // anything, so you can just blindly call this function all you want. | 36 // anything, so you can just blindly call this function all you want. |
| 34 // This is Called from chrome/browser/browser_about_handler.cc | 37 // This is Called from chrome/browser/browser_about_handler.cc |
| 35 void ShowAboutIPCDialog(); | 38 void ShowAboutIPCDialog(); |
| 36 | 39 |
| 37 #endif // IPC_MESSAGE_LOG_ENABLED | 40 #endif // IPC_MESSAGE_LOG_ENABLED |
| 38 | 41 |
| 39 // Creates and shows an HTML dialog with the given delegate and profile. | 42 // Creates and shows an HTML dialog with the given delegate and profile. |
| 40 // The window is automatically destroyed when it is closed. |browser| can be | 43 // The window is automatically destroyed when it is closed. |browser| can be |
| 41 // NULL if the profile used is not incognito, otherwise the window will be | 44 // NULL if the profile used is not incognito, otherwise the window will be |
| 42 // closed if the browser is closed. | 45 // closed if the browser is closed. |
| 43 // Returns the created window. | 46 // Returns the created window. |
| 44 // | 47 // |
| 45 // Make sure to use the returned window only when you know it is safe | 48 // Make sure to use the returned window only when you know it is safe |
| 46 // to do so, i.e. before OnDialogClosed() is called on the delegate. | 49 // to do so, i.e. before OnDialogClosed() is called on the delegate. |
| 47 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent, | 50 gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent, |
| 48 Profile* profile, | 51 Profile* profile, |
| 49 Browser* browser, | 52 Browser* browser, |
| 50 WebDialogDelegate* delegate); | 53 ui::WebDialogDelegate* delegate); |
| 51 | 54 |
| 52 // Shows the collected cookies dialog box. | 55 // Shows the collected cookies dialog box. |
| 53 void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window, | 56 void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window, |
| 54 TabContentsWrapper* tab_contents); | 57 TabContentsWrapper* tab_contents); |
| 55 | 58 |
| 56 // Creates the ExtensionInstalledBubble and schedules it to be shown once | 59 // Creates the ExtensionInstalledBubble and schedules it to be shown once |
| 57 // the extension has loaded. |extension| is the installed extension. |browser| | 60 // the extension has loaded. |extension| is the installed extension. |browser| |
| 58 // is the browser window which will host the bubble. |icon| is the install | 61 // is the browser window which will host the bubble. |icon| is the install |
| 59 // icon of the extension. | 62 // icon of the extension. |
| 60 void ShowExtensionInstalledBubble(const extensions::Extension* extension, | 63 void ShowExtensionInstalledBubble(const extensions::Extension* extension, |
| 61 Browser* browser, | 64 Browser* browser, |
| 62 const SkBitmap& icon, | 65 const SkBitmap& icon, |
| 63 Profile* profile); | 66 Profile* profile); |
| 64 | 67 |
| 65 // Shows or hide the hung renderer dialog for the given WebContents. | 68 // Shows or hide the hung renderer dialog for the given WebContents. |
| 66 // We need to pass the WebContents to the dialog, because multiple tabs can hang | 69 // We need to pass the WebContents to the dialog, because multiple tabs can hang |
| 67 // and it needs to keep track of which tabs are currently hung. | 70 // and it needs to keep track of which tabs are currently hung. |
| 68 void ShowHungRendererDialog(content::WebContents* contents); | 71 void ShowHungRendererDialog(content::WebContents* contents); |
| 69 void HideHungRendererDialog(content::WebContents* contents); | 72 void HideHungRendererDialog(content::WebContents* contents); |
| 70 | 73 |
| 71 // Shows a tab-modal dialog box. | 74 // Shows a tab-modal dialog box. |
| 72 void ShowTabModalConfirmDialog(TabModalConfirmDialogDelegate* delegate, | 75 void ShowTabModalConfirmDialog(TabModalConfirmDialogDelegate* delegate, |
| 73 TabContentsWrapper* wrapper); | 76 TabContentsWrapper* wrapper); |
| 74 | 77 |
| 75 } // namespace browser | 78 } // namespace browser |
| 76 | 79 |
| 77 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ | 80 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |
| OLD | NEW |