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

Unified Diff: chrome/browser/autofill/autofill_cc_infobar_delegate.cc

Issue 10417036: Remove BrowserList usage from autofill CC infobar delegate, replacing it with using content api dir… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_cc_infobar_delegate.cc
===================================================================
--- chrome/browser/autofill/autofill_cc_infobar_delegate.cc (revision 138102)
+++ chrome/browser/autofill/autofill_cc_infobar_delegate.cc (working copy)
@@ -7,8 +7,11 @@
#include "base/logging.h"
#include "chrome/browser/autofill/credit_card.h"
#include "chrome/browser/autofill/personal_data_manager.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
+#include "chrome/common/url_constants.h"
+#include "content/public/browser/page_navigator.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_delegate.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
#include "ui/base/l10n/l10n_util.h"
@@ -86,14 +89,12 @@
}
bool AutofillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
-#if defined(OS_ANDROID)
- // There's no link for infobars on Android.
- NOTREACHED();
+ owner()->web_contents()->GetDelegate()->OpenURLFromTab(
+ owner()->web_contents(),
+ content::OpenURLParams(GURL(chrome::kAutofillHelpURL),
+ content::Referrer(),
+ NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK,
+ false));
return false;
-#else
- Browser* browser = BrowserList::GetLastActive();
- DCHECK(browser);
- browser->OpenAutofillHelpTabAndActivate();
- return false;
-#endif // #if defined(OS_ANDROID)
}
« no previous file with comments | « no previous file | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698