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

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..785e706f9556e463d86ab63bf75d0d787e67854e 100644
--- a/chrome/browser/gpu/three_d_api_observer.cc
+++ b/chrome/browser/gpu/three_d_api_observer.cc
@@ -38,8 +38,9 @@ class ThreeDAPIInfoBarDelegate : public ConfirmInfoBarDelegate {
~ThreeDAPIInfoBarDelegate() override;
// ConfirmInfoBarDelegate:
- bool EqualsDelegate(infobars::InfoBarDelegate* delegate) const override;
int GetIconID() const override;
+ bool EqualsDelegate(infobars::InfoBarDelegate* delegate) const override;
+ ThreeDAPIInfoBarDelegate* AsThreeDAPIInfoBarDelegate() override;
base::string16 GetMessageText() const override;
base::string16 GetButtonLabel(InfoBarButton button) const override;
bool Accept() override;
@@ -85,17 +86,22 @@ ThreeDAPIInfoBarDelegate::~ThreeDAPIInfoBarDelegate() {
}
}
+int ThreeDAPIInfoBarDelegate::GetIconID() const {
+ return IDR_INFOBAR_3D_BLOCKED;
+}
+
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 {
- return IDR_INFOBAR_3D_BLOCKED;
+ThreeDAPIInfoBarDelegate*
+ ThreeDAPIInfoBarDelegate::AsThreeDAPIInfoBarDelegate() {
+ return this;
}
base::string16 ThreeDAPIInfoBarDelegate::GetMessageText() const {
« no previous file with comments | « chrome/browser/geolocation/geolocation_infobar_delegate.h ('k') | chrome/browser/media/media_stream_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698