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

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

Issue 2144903004: New location security strings and animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't look at level any more 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.cc
diff --git a/chrome/browser/ui/views/location_bar/location_icon_view.cc b/chrome/browser/ui/views/location_bar/location_icon_view.cc
index ac6951e4ccb59e143e87790f7a1c97d138a55f05..5f6cb17566252ea7f35815fa0ba820d9e559628e 100644
--- a/chrome/browser/ui/views/location_bar/location_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_icon_view.cc
@@ -22,7 +22,6 @@
#include "ui/views/controls/label.h"
#include "ui/views/painter.h"
-using content::NavigationController;
using content::NavigationEntry;
using content::WebContents;
@@ -34,7 +33,8 @@ LocationIconView::LocationIconView(const gfx::FontList& font_list,
parent_background_color,
true),
suppress_mouse_released_action_(false),
- location_bar_(location_bar) {
+ location_bar_(location_bar),
+ animation_(this) {
set_id(VIEW_ID_LOCATION_ICON);
#if defined(OS_MACOSX)
@@ -44,6 +44,7 @@ LocationIconView::LocationIconView(const gfx::FontList& font_list,
#endif
SetBackground(false);
+ animation_.SetSlideDuration(kOpenTimeMS);
}
LocationIconView::~LocationIconView() {
@@ -104,7 +105,7 @@ bool LocationIconView::GetTooltipText(const gfx::Point& p,
}
SkColor LocationIconView::GetTextColor() const {
- return location_bar_->GetColor(LocationBarView::EV_BUBBLE_TEXT_AND_BORDER);
+ return location_bar_->GetColor(LocationBarView::SECURITY_CHIP_TEXT);
}
SkColor LocationIconView::GetBorderColor() const {
@@ -146,6 +147,31 @@ void LocationIconView::SetBackground(bool should_show_ev) {
UnsetBackgroundImageGrid();
}
+void LocationIconView::AnimateSecurityChip() {
+ animation_.Show();
+}
+
+void LocationIconView::ShowSecurityChip() {
+ animation_.Reset(1);
+}
+
+void LocationIconView::HideSecurityChip() {
+ animation_.Reset(0);
+}
+
+bool LocationIconView::IsAnimatingSecurityChip() {
+ return animation_.is_animating();
+}
+
+void LocationIconView::AnimationProgressed(const gfx::Animation*) {
Peter Kasting 2016/08/26 20:59:12 Nit: These two functions' definition order is reve
Kevin Bailey 2016/08/29 13:38:10 Done.
+ location_bar_->Layout();
+ location_bar_->SchedulePaint();
+}
+
+double LocationIconView::WidthMultiplier() const {
+ return animation_.GetCurrentValue();
+}
+
void LocationIconView::ProcessLocatedEvent(const ui::LocatedEvent& event) {
if (HitTestPoint(event.location()))
OnActivate(event);

Powered by Google App Engine
This is Rietveld 408576698