Index: chrome/browser/gpu/three_d_api_observer.cc |
diff --git a/chrome/browser/gpu/three_d_api_observer.cc b/chrome/browser/gpu/three_d_api_observer.cc |
index 7396f8571bc5cda000e9eddcac339b1d31a2a1df..83f71c79cfbe7cdc1d098bb984de90ba66d1df09 100644 |
--- a/chrome/browser/gpu/three_d_api_observer.cc |
+++ b/chrome/browser/gpu/three_d_api_observer.cc |
@@ -39,6 +39,7 @@ class ThreeDAPIInfoBarDelegate : public ConfirmInfoBarDelegate { |
// ConfirmInfoBarDelegate: |
bool EqualsDelegate(infobars::InfoBarDelegate* delegate) const override; |
+ ThreeDAPIInfoBarDelegate* AsThreeDAPIInfoBarDelegate() override; |
int GetIconID() const override; |
base::string16 GetMessageText() const override; |
base::string16 GetButtonLabel(InfoBarButton button) const override; |
@@ -85,13 +86,18 @@ ThreeDAPIInfoBarDelegate::~ThreeDAPIInfoBarDelegate() { |
} |
} |
+ThreeDAPIInfoBarDelegate* |
+ ThreeDAPIInfoBarDelegate::AsThreeDAPIInfoBarDelegate() { |
+ return this; |
+} |
+ |
bool ThreeDAPIInfoBarDelegate::EqualsDelegate( |
infobars::InfoBarDelegate* delegate) const { |
// For the time being, if a given web page is actually using both |
// WebGL and Pepper 3D and both APIs are blocked, just leave the |
// first infobar up. If the user selects "try again", both APIs will |
// be unblocked and the web page reload will succeed. |
- return delegate->GetIconID() == GetIconID(); |
+ return !!delegate->AsThreeDAPIInfoBarDelegate(); |
} |
int ThreeDAPIInfoBarDelegate::GetIconID() const { |