Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1906)

Unified Diff: chrome/browser/gpu/three_d_api_observer.cc

Issue 922953002: Minor infobar cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698