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