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

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: Minor responses 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_icon_view.h ('k') | components/omnibox_strings.grdp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d6604455abc48ccfe3f9d6ddb077a6c9bca26ea3 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,25 @@ void LocationIconView::SetBackground(bool should_show_ev) {
UnsetBackgroundImageGrid();
}
+void LocationIconView::SetSecurityState(bool should_show, bool should_animate) {
+ if (!should_animate) {
+ animation_.Reset(should_show);
+ } else if (should_show) {
+ animation_.Show();
+ } else {
+ animation_.Hide();
+ }
+}
+
+double LocationIconView::WidthMultiplier() const {
+ return animation_.GetCurrentValue();
+}
+
+void LocationIconView::AnimationProgressed(const gfx::Animation*) {
+ location_bar_->Layout();
+ location_bar_->SchedulePaint();
+}
+
void LocationIconView::ProcessLocatedEvent(const ui::LocatedEvent& event) {
if (HitTestPoint(event.location()))
OnActivate(event);
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_icon_view.h ('k') | components/omnibox_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698