Upstream version 9.37.195.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / autofill / autofill_cc_infobar_delegate.cc
index a3cebc1..7d13104 100644 (file)
@@ -5,11 +5,11 @@
 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h"
 
 #include "base/logging.h"
-#include "chrome/browser/infobars/infobar.h"
 #include "chrome/browser/infobars/infobar_service.h"
 #include "components/autofill/core/browser/credit_card.h"
 #include "components/autofill/core/browser/personal_data_manager.h"
 #include "components/autofill/core/common/autofill_constants.h"
+#include "components/infobars/core/infobar.h"
 #include "content/public/browser/page_navigator.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/browser/web_contents_delegate.h"
@@ -58,15 +58,16 @@ void AutofillCCInfoBarDelegate::InfoBarDismissed() {
 }
 
 int AutofillCCInfoBarDelegate::GetIconID() const {
-  return IDR_INFOBAR_AUTOFILL;
+  return IDR_INFOBAR_AUTOFILL_CC;
 }
 
-InfoBarDelegate::Type AutofillCCInfoBarDelegate::GetInfoBarType() const {
+infobars::InfoBarDelegate::Type AutofillCCInfoBarDelegate::GetInfoBarType()
+    const {
   return PAGE_ACTION_TYPE;
 }
 
 bool AutofillCCInfoBarDelegate::ShouldExpireInternal(
-    const content::LoadCommittedDetails& details) const {
+    const NavigationDetails& details) const {
   // The user has submitted a form, causing the page to navigate elsewhere. We
   // don't want the infobar to be expired at this point, because the user won't
   // get a chance to answer the question.
@@ -100,10 +101,11 @@ base::string16 AutofillCCInfoBarDelegate::GetLinkText() const {
 }
 
 bool AutofillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
-  web_contents()->OpenURL(content::OpenURLParams(
-      GURL(autofill::kHelpURL), content::Referrer(),
-      (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
-      content::PAGE_TRANSITION_LINK, false));
+  InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL(
+      content::OpenURLParams(
+          GURL(autofill::kHelpURL), content::Referrer(),
+          (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+          content::PAGE_TRANSITION_LINK, false));
   return false;
 }