#include "base/metrics/histogram.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
-#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/tab_contents/tab_util.h"
+#include "components/infobars/core/infobar.h"
#include "content/public/browser/gpu_data_manager.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
virtual ~ThreeDAPIInfoBarDelegate();
// ConfirmInfoBarDelegate:
- virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE;
+ virtual bool EqualsDelegate(
+ infobars::InfoBarDelegate* delegate) const OVERRIDE;
virtual int GetIconID() const OVERRIDE;
virtual base::string16 GetMessageText() const OVERRIDE;
virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
}
}
-bool ThreeDAPIInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
+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
UMA_HISTOGRAM_ENUMERATION("GPU.ThreeDAPIInfoBarDismissal", RELOADED,
DISMISSAL_MAX);
content::GpuDataManager::GetInstance()->UnblockDomainFrom3DAPIs(url_);
- web_contents()->GetController().Reload(true);
+ InfoBarService::WebContentsFromInfoBar(infobar())->GetController().Reload(
+ true);
return true;
}
}
bool ThreeDAPIInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
- web_contents()->OpenURL(content::OpenURLParams(
- GURL("https://support.google.com/chrome/?p=ib_webgl"),
- content::Referrer(),
- (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK,
- false));
+ InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL(
+ content::OpenURLParams(
+ GURL("https://support.google.com/chrome/?p=ib_webgl"),
+ content::Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ content::PAGE_TRANSITION_LINK, false));
return false;
}