Commit 1a0ebdac authored by ben@chromium.org's avatar ben@chromium.org

Remove BrowserList usage from autofill CC infobar delegate, replacing it with...

Remove BrowserList usage from autofill CC infobar delegate, replacing it with using content api directly to open a tab in the relevant context. This also allows us to remove some cruft from Browser.

http://crbug.com/129187
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10417036

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138379 0039d316-1c4b-4281-b951-d872f2087c98
parent ff3761a1
...@@ -7,8 +7,11 @@ ...@@ -7,8 +7,11 @@
#include "base/logging.h" #include "base/logging.h"
#include "chrome/browser/autofill/credit_card.h" #include "chrome/browser/autofill/credit_card.h"
#include "chrome/browser/autofill/personal_data_manager.h" #include "chrome/browser/autofill/personal_data_manager.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/ui/browser_list.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/generated_resources.h"
#include "grit/theme_resources_standard.h" #include "grit/theme_resources_standard.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -86,14 +89,12 @@ string16 AutofillCCInfoBarDelegate::GetLinkText() const { ...@@ -86,14 +89,12 @@ string16 AutofillCCInfoBarDelegate::GetLinkText() const {
} }
bool AutofillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { bool AutofillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
#if defined(OS_ANDROID) owner()->web_contents()->GetDelegate()->OpenURLFromTab(
// There's no link for infobars on Android. owner()->web_contents(),
NOTREACHED(); content::OpenURLParams(GURL(chrome::kAutofillHelpURL),
content::Referrer(),
NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK,
false));
return false; return false;
#else
Browser* browser = BrowserList::GetLastActive();
DCHECK(browser);
browser->OpenAutofillHelpTabAndActivate();
return false;
#endif // #if defined(OS_ANDROID)
} }
...@@ -2256,11 +2256,6 @@ void Browser::ShowHelpTab() { ...@@ -2256,11 +2256,6 @@ void Browser::ShowHelpTab() {
ShowSingletonTab(GURL(chrome::kChromeHelpURL)); ShowSingletonTab(GURL(chrome::kChromeHelpURL));
} }
void Browser::OpenAutofillHelpTabAndActivate() {
AddSelectedTabWithURL(GURL(chrome::kAutofillHelpURL),
content::PAGE_TRANSITION_LINK);
}
void Browser::OpenPrivacyDashboardTabAndActivate() { void Browser::OpenPrivacyDashboardTabAndActivate() {
OpenURL(OpenURLParams( OpenURL(OpenURLParams(
GURL(kPrivacyDashboardUrl), Referrer(), GURL(kPrivacyDashboardUrl), Referrer(),
......
...@@ -658,7 +658,6 @@ class Browser : public TabStripModelDelegate, ...@@ -658,7 +658,6 @@ class Browser : public TabStripModelDelegate,
void OpenAboutChromeDialog(); void OpenAboutChromeDialog();
void OpenUpdateChromeDialog(); void OpenUpdateChromeDialog();
void ShowHelpTab(); void ShowHelpTab();
void OpenAutofillHelpTabAndActivate();
void OpenPrivacyDashboardTabAndActivate(); void OpenPrivacyDashboardTabAndActivate();
void OpenSearchEngineOptionsDialog(); void OpenSearchEngineOptionsDialog();
void OpenPluginsTabAndActivate(); void OpenPluginsTabAndActivate();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment