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

Unified Diff: chrome/browser/ui/views/location_bar/save_credit_card_icon_view.cc

Issue 1396923003: Autofill: Replace "save credit card" infobar with a bubble (Views only). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: chrome/browser/ui/views/location_bar/save_credit_card_icon_view.cc
diff --git a/chrome/browser/ui/views/location_bar/save_credit_card_icon_view.cc b/chrome/browser/ui/views/location_bar/save_credit_card_icon_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d5d08ae5dcaf28907c908a4cdcf48b1193f3a6d1
--- /dev/null
+++ b/chrome/browser/ui/views/location_bar/save_credit_card_icon_view.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/location_bar/save_credit_card_icon_view.h"
+
+#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/ui/view_ids.h"
+#include "chrome/browser/ui/views/autofill/save_card_bubble_view.h"
+#include "chrome/grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/color_palette.h"
+#include "ui/gfx/paint_vector_icon.h"
+#include "ui/gfx/vector_icons_public.h"
+
+SaveCreditCardIconView::SaveCreditCardIconView(CommandUpdater* command_updater)
+ : BubbleIconView(command_updater, IDC_SAVE_CREDIT_CARD_FOR_PAGE) {
+ set_id(VIEW_ID_SAVE_CREDIT_CARD_BUTTON);
+ // TODO(bondd) before commit: Use proper tooltip.
+ SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_TRANSLATE));
+ SetToggled(false);
+}
+
+SaveCreditCardIconView::~SaveCreditCardIconView() {}
+
+void SaveCreditCardIconView::SetToggled(bool on) {
+ SetImage(gfx::CreateVectorIcon(gfx::VectorIconId::AUTOFILL, 16,
Evan Stade 2015/10/09 18:54:45 this is slightly out of date now (after a recent c
bondd 2015/10/15 22:27:08 Acknowledged.
+ on ? gfx::kGoogleBlue : gfx::kChromeIconGrey));
+}
+
+void SaveCreditCardIconView::OnExecuting(
+ BubbleIconView::ExecuteSource execute_source) {}
+
+views::BubbleDelegateView* SaveCreditCardIconView::GetBubble() const {
+ return autofill::SaveCardBubbleView::GetCurrentBubble();
+}

Powered by Google App Engine
This is Rietveld 408576698