Home | History | Annotate | Download | only in views
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_WIN_H_
      6 #define CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_WIN_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "content/public/browser/web_contents.h"
     10 
     11 // This class provides functionality to display a Windows 8 metro style hung
     12 // renderer dialog.
     13 class HungRendererDialogMetro {
     14  public:
     15   // Creates or returns the global instance of the HungRendererDialogMetro
     16   // class
     17   static HungRendererDialogMetro* Create();
     18   static HungRendererDialogMetro* GetInstance();
     19 
     20   void Show(content::WebContents* contents);
     21   void Hide(content::WebContents* contents);
     22 
     23  private:
     24   HungRendererDialogMetro();
     25   ~HungRendererDialogMetro();
     26 
     27   // Handlers for the hang monitor dialog displayed in Windows 8 metro.
     28   static void OnMetroKillProcess();
     29   static void OnMetroWait();
     30 
     31   // Resets Windows 8 metro specific state like whether the dialog was
     32   // displayed, etc.
     33   void ResetMetroState();
     34 
     35   content::WebContents* contents_;
     36 
     37   // Set to true if the metro version of the hang dialog is displayed.
     38   // Helps ensure that only one instance of the dialog is displayed at any
     39   // given time.
     40   bool metro_dialog_displayed_;
     41 
     42   // Pointer to the global instance of the HungRendererDialogMetro class.
     43   static HungRendererDialogMetro* g_instance_;
     44 
     45   DISALLOW_COPY_AND_ASSIGN(HungRendererDialogMetro);
     46 };
     47 
     48 #endif  // CHROME_BROWSER_UI_VIEWS_HUNG_RENDERER_VIEW_WIN_H_
     49 
     50