Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / three_d_api_observer.cc
index 94d3b38..248f5f9 100644 (file)
@@ -6,9 +6,9 @@
 
 #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"
@@ -37,7 +37,8 @@ class ThreeDAPIInfoBarDelegate : public ConfirmInfoBarDelegate {
   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;
@@ -84,7 +85,8 @@ ThreeDAPIInfoBarDelegate::~ThreeDAPIInfoBarDelegate() {
   }
 }
 
-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
@@ -132,7 +134,8 @@ bool ThreeDAPIInfoBarDelegate::Cancel() {
   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;
 }
 
@@ -141,12 +144,12 @@ base::string16 ThreeDAPIInfoBarDelegate::GetLinkText() const {
 }
 
 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;
 }