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

Unified Diff: chrome/browser/ui/views/location_bar/location_icon_view.h

Issue 2144903004: New location security strings and animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't animate if level is same Created 4 years, 4 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/location_icon_view.h
diff --git a/chrome/browser/ui/views/location_bar/location_icon_view.h b/chrome/browser/ui/views/location_bar/location_icon_view.h
index f056a1c43e1930cd3ba6d47d3067bccfe2262377..d78f08997ed05b87303ca30508e38d97de56b5e3 100644
--- a/chrome/browser/ui/views/location_bar/location_icon_view.h
+++ b/chrome/browser/ui/views/location_bar/location_icon_view.h
@@ -7,6 +7,8 @@
#include "base/macros.h"
#include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h"
+#include "ui/gfx/animation/animation_delegate.h"
+#include "ui/gfx/animation/slide_animation.h"
class LocationBarView;
@@ -18,7 +20,8 @@ class LocatedEvent;
// Use a LocationIconView to display an icon on the leading side of the edit
// field. It shows the user's current action (while the user is editing), or the
// page security status (after navigation has completed).
-class LocationIconView : public IconLabelBubbleView {
+class LocationIconView : public IconLabelBubbleView,
+ public gfx::AnimationDelegate {
public:
LocationIconView(const gfx::FontList& font_list,
SkColor parent_background_color,
@@ -49,6 +52,13 @@ class LocationIconView : public IconLabelBubbleView {
// HTTPS contexts.
void SetBackground(bool should_show_ev);
+ void AnimateSecurityChip();
+ // Immediately show full security chip.
+ void ShowSecurityChip();
+ // Immediately hide security chip.
+ void HideSecurityChip();
+ bool IsAnimatingSecurityChip();
+
private:
void ProcessLocatedEvent(const ui::LocatedEvent& event);
@@ -59,6 +69,11 @@ class LocationIconView : public IconLabelBubbleView {
// helper in the appropriate circumstances.
void OnClickOrTap(const ui::LocatedEvent& event);
+ // gfx::AnimationDelegate:
Peter Kasting 2016/08/20 01:16:43 Nit: The public section puts overrides above non-v
Kevin Bailey 2016/08/22 15:58:57 I moved them up and added an annotation.
+ void AnimationProgressed(const gfx::Animation*) override;
+
Peter Kasting 2016/08/20 01:16:43 Nit: No blank line
Kevin Bailey 2016/08/22 15:58:57 Might be ok after latest change.
+ double WidthMultiplier() const override;
+
// Set to true when the bubble is already showing at the time the icon is
// clicked. This suppresses re-showing the bubble on mouse release, so that
// clicking the icon repeatedly will appear to toggle the bubble on and off.
@@ -69,6 +84,8 @@ class LocationIconView : public IconLabelBubbleView {
LocationBarView* location_bar_;
Peter Kasting 2016/08/20 01:16:43 Nit: No blank line
Kevin Bailey 2016/08/22 15:58:57 Done.
+ gfx::SlideAnimation animation_;
+
DISALLOW_COPY_AND_ASSIGN(LocationIconView);
};

Powered by Google App Engine
This is Rietveld 408576698