summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/autofill_profiles_view_win.cc
diff options
context:
space:
mode:
authorgeorgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 23:04:04 +0000
committergeorgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 23:04:04 +0000
commitef7090c7e60de7d41bedb7bf5ae1c74dc52786fd (patch)
treeb49deed2e98661b8e35d58f863d2176692e955ac /chrome/browser/views/autofill_profiles_view_win.cc
parentaec567d219a25597c3b854571201b585fb1a5f6b (diff)
downloadchromium_src-ef7090c7e60de7d41bedb7bf5ae1c74dc52786fd.zip
chromium_src-ef7090c7e60de7d41bedb7bf5ae1c74dc52786fd.tar.gz
chromium_src-ef7090c7e60de7d41bedb7bf5ae1c74dc52786fd.tar.bz2
Added "Learn More" link to autofill on Windows.
TEST=Should appear on the bottom left in autofill dialog and should work when clicked :) BUG=none Review URL: http://codereview.chromium.org/1551020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43892 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/autofill_profiles_view_win.cc')
-rw-r--r--chrome/browser/views/autofill_profiles_view_win.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/chrome/browser/views/autofill_profiles_view_win.cc b/chrome/browser/views/autofill_profiles_view_win.cc
index 5951b49..db30b6f 100644
--- a/chrome/browser/views/autofill_profiles_view_win.cc
+++ b/chrome/browser/views/autofill_profiles_view_win.cc
@@ -9,6 +9,7 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/message_loop.h"
+#include "chrome/browser/autofill/autofill_manager.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
@@ -236,6 +237,27 @@ std::wstring AutoFillProfilesView::GetDialogButtonLabel(
return std::wstring();
}
+views::View* AutoFillProfilesView::GetExtraView() {
+ // The dialog sizes the extra view to fill the entire available space.
+ // We use a container to lay it out properly.
+ views::View* link_container = new views::View();
+ views::GridLayout* layout = new views::GridLayout(link_container);
+ link_container->SetLayoutManager(layout);
+
+ views::ColumnSet* column_set = layout->AddColumnSet(0);
+ column_set->AddPaddingColumn(0, kDialogPadding);
+ column_set->AddColumn(views::GridLayout::LEADING,
+ views::GridLayout::LEADING, 0,
+ views::GridLayout::USE_PREF, 0, 0);
+ layout->StartRow(0, 0);
+ views::Link* link = new views::Link(
+ l10n_util::GetString(IDS_AUTOFILL_LEARN_MORE));
+ link->SetController(this);
+ layout->AddView(link);
+
+ return link_container;
+}
+
bool AutoFillProfilesView::IsDialogButtonEnabled(
MessageBoxFlags::DialogButton button) const {
switch (button) {
@@ -306,6 +328,15 @@ void AutoFillProfilesView::ButtonPressed(views::Button* sender,
}
/////////////////////////////////////////////////////////////////////////////
+// AutoFillProfilesView, views::LinkController implementations:
+void AutoFillProfilesView::LinkActivated(views::Link* source, int event_flags) {
+ Browser* browser = BrowserList::GetLastActive();
+ browser->OpenURL(GURL(kAutoFillLearnMoreUrl), GURL(), NEW_FOREGROUND_TAB,
+ PageTransition::TYPED);
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
// AutoFillProfilesView, views::FocusChangeListener implementations:
void AutoFillProfilesView::FocusWillChange(views::View* focused_before,
views::View* focused_now) {