OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_ANDROID_HUNG_RENDERER_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_HUNG_RENDERER_INFOBAR_DELEGATE_H_ |
| 7 |
| 8 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 9 |
| 10 namespace content { |
| 11 class WebContent; |
| 12 } |
| 13 |
| 14 // This class is responsible for customizing a hung renderer infobar. |
| 15 // If the "kill" dialog is clicked, the renderer of the corresponding |
| 16 // WebContents will be shutdown. |
| 17 class HungRendererInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 18 public: |
| 19 // The caller must ensure that |web_contents| outlives the delegate. |
| 20 // This will naturally occur if the associated InfoBar is managed by the |
| 21 // InfoBarService. |
| 22 explicit HungRendererInfoBarDelegate(content::WebContents* web_contents); |
| 23 ~HungRendererInfoBarDelegate() override; |
| 24 |
| 25 // ConfirmInfoBarDelegate: |
| 26 int GetIconID() const override; |
| 27 base::string16 GetMessageText() const override; |
| 28 base::string16 GetButtonLabel(InfoBarButton button) const override; |
| 29 bool Accept() override; |
| 30 |
| 31 private: |
| 32 content::WebContents* web_contents_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(HungRendererInfoBarDelegate); |
| 35 }; |
| 36 |
| 37 #endif // CHROME_BROWSER_ANDROID_HUNG_RENDERER_INFOBAR_DELEGATE_H_ |
OLD | NEW |