| 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_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 #if defined(OS_CHROMEOS) |
| 13 #include "chrome/browser/chromeos/frame/bubble_window_style.h" |
| 14 #endif |
| 15 |
| 12 class Browser; | 16 class Browser; |
| 13 class Extension; | 17 class Extension; |
| 14 class HtmlDialogUIDelegate; | 18 class HtmlDialogUIDelegate; |
| 15 class Profile; | 19 class Profile; |
| 16 class SkBitmap; | 20 class SkBitmap; |
| 17 class TabContents; | 21 class TabContents; |
| 18 class TemplateURL; | 22 class TemplateURL; |
| 19 | 23 |
| 20 namespace browser { | 24 namespace browser { |
| 21 | 25 |
| 22 #if defined(IPC_MESSAGE_LOG_ENABLED) | 26 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 23 | 27 |
| 24 // The dialog is a singleton. If the dialog is already opened, it won't do | 28 // The dialog is a singleton. If the dialog is already opened, it won't do |
| 25 // anything, so you can just blindly call this function all you want. | 29 // anything, so you can just blindly call this function all you want. |
| 26 // This is Called from chrome/browser/browser_about_handler.cc | 30 // This is Called from chrome/browser/browser_about_handler.cc |
| 27 void ShowAboutIPCDialog(); | 31 void ShowAboutIPCDialog(); |
| 28 | 32 |
| 29 #endif // IPC_MESSAGE_LOG_ENABLED | 33 #endif // IPC_MESSAGE_LOG_ENABLED |
| 30 | 34 |
| 31 // Creates and shows an HTML dialog with the given delegate and profile. | 35 // Creates and shows an HTML dialog with the given delegate and profile. |
| 32 // The window is automatically destroyed when it is closed. | 36 // The window is automatically destroyed when it is closed. |
| 33 // Returns the created window. | 37 // Returns the created window. |
| 34 // | 38 // |
| 35 // Make sure to use the returned window only when you know it is safe | 39 // Make sure to use the returned window only when you know it is safe |
| 36 // to do so, i.e. before OnDialogClosed() is called on the delegate. | 40 // to do so, i.e. before OnDialogClosed() is called on the delegate. |
| 41 #if defined(OS_CHROMEOS) |
| 42 gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent, Profile* profile, |
| 43 HtmlDialogUIDelegate* delegate, |
| 44 chromeos::BubbleWindowStyle style = |
| 45 chromeos::STYLE_GENERIC); |
| 46 #else |
| 37 gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent, Profile* profile, | 47 gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent, Profile* profile, |
| 38 HtmlDialogUIDelegate* delegate); | 48 HtmlDialogUIDelegate* delegate); |
| 49 #endif |
| 39 | 50 |
| 40 // Creates the ExtensionInstalledBubble and schedules it to be shown once | 51 // Creates the ExtensionInstalledBubble and schedules it to be shown once |
| 41 // the extension has loaded. |extension| is the installed extension. |browser| | 52 // the extension has loaded. |extension| is the installed extension. |browser| |
| 42 // is the browser window which will host the bubble. |icon| is the install | 53 // is the browser window which will host the bubble. |icon| is the install |
| 43 // icon of the extension. | 54 // icon of the extension. |
| 44 void ShowExtensionInstalledBubble(const Extension* extension, | 55 void ShowExtensionInstalledBubble(const Extension* extension, |
| 45 Browser* browser, | 56 Browser* browser, |
| 46 const SkBitmap& icon, | 57 const SkBitmap& icon, |
| 47 Profile* profile); | 58 Profile* profile); |
| 48 | 59 |
| 49 // Shows or hide the hung renderer dialog for the given TabContents. | 60 // Shows or hide the hung renderer dialog for the given TabContents. |
| 50 // We need to pass the TabContents to the dialog, because multiple tabs can hang | 61 // We need to pass the TabContents to the dialog, because multiple tabs can hang |
| 51 // and it needs to keep track of which tabs are currently hung. | 62 // and it needs to keep track of which tabs are currently hung. |
| 52 void ShowHungRendererDialog(TabContents* contents); | 63 void ShowHungRendererDialog(TabContents* contents); |
| 53 void HideHungRendererDialog(TabContents* contents); | 64 void HideHungRendererDialog(TabContents* contents); |
| 54 | 65 |
| 55 // Native implementations of hung renderer dialogs. | 66 // Native implementations of hung renderer dialogs. |
| 56 void ShowNativeHungRendererDialog(TabContents* contents); | 67 void ShowNativeHungRendererDialog(TabContents* contents); |
| 57 void HideNativeHungRendererDialog(TabContents* contents); | 68 void HideNativeHungRendererDialog(TabContents* contents); |
| 58 | 69 |
| 59 // Show the edit search engine dialog. | 70 // Show the edit search engine dialog. |
| 60 void ConfirmAddSearchProvider(const TemplateURL* template_url, | 71 void ConfirmAddSearchProvider(const TemplateURL* template_url, |
| 61 Profile* profile); | 72 Profile* profile); |
| 62 | 73 |
| 63 } // namespace browser | 74 } // namespace browser |
| 64 | 75 |
| 65 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ | 76 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |
| OLD | NEW |