Home | History | Annotate | Download | only in ui
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
      6 #define CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
      7 #pragma once
      8 
      9 #include "ipc/ipc_message.h"
     10 #include "ui/gfx/native_widget_types.h"
     11 
     12 class Browser;
     13 class Extension;
     14 class HtmlDialogUIDelegate;
     15 class Profile;
     16 class SkBitmap;
     17 class TabContents;
     18 
     19 namespace browser {
     20 
     21 #if defined(IPC_MESSAGE_LOG_ENABLED)
     22 
     23 // The dialog is a singleton. If the dialog is already opened, it won't do
     24 // anything, so you can just blindly call this function all you want.
     25 // This is Called from chrome/browser/browser_about_handler.cc
     26 void ShowAboutIPCDialog();
     27 
     28 #endif  // IPC_MESSAGE_LOG_ENABLED
     29 
     30 // Creates and shows an HTML dialog with the given delegate and profile.
     31 // The window is automatically destroyed when it is closed.
     32 // Returns the created window.
     33 //
     34 // Make sure to use the returned window only when you know it is safe
     35 // to do so, i.e. before OnDialogClosed() is called on the delegate.
     36 gfx::NativeWindow ShowHtmlDialog(gfx::NativeWindow parent, Profile* profile,
     37                                  HtmlDialogUIDelegate* delegate);
     38 
     39 // Creates the ExtensionInstalledBubble and schedules it to be shown once
     40 // the extension has loaded. |extension| is the installed extension. |browser|
     41 // is the browser window which will host the bubble. |icon| is the install
     42 // icon of the extension.
     43 void ShowExtensionInstalledBubble(const Extension* extension,
     44                                   Browser* browser,
     45                                   const SkBitmap& icon,
     46                                   Profile* profile);
     47 
     48 // Shows or hide the hung renderer dialog for the given TabContents.
     49 // We need to pass the TabContents to the dialog, because multiple tabs can hang
     50 // and it needs to keep track of which tabs are currently hung.
     51 void ShowHungRendererDialog(TabContents* contents);
     52 void HideHungRendererDialog(TabContents* contents);
     53 
     54 } // namespace browser
     55 
     56 #endif  // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
     57