OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/location_bar/origin_chip_view.h" | 5 #include "chrome/browser/ui/views/location_bar/origin_chip_view.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 // TODO(gbillock): Would be nice to just use stock LabelButton stuff here. | 160 // TODO(gbillock): Would be nice to just use stock LabelButton stuff here. |
161 location_icon_view_ = new LocationIconView(location_bar_view_); | 161 location_icon_view_ = new LocationIconView(location_bar_view_); |
162 // Make location icon hover events count as hovering the origin chip. | 162 // Make location icon hover events count as hovering the origin chip. |
163 location_icon_view_->set_interactive(false); | 163 location_icon_view_->set_interactive(false); |
164 location_icon_view_->ShowTooltip(true); | 164 location_icon_view_->ShowTooltip(true); |
165 AddChildView(location_icon_view_); | 165 AddChildView(location_icon_view_); |
166 | 166 |
167 ev_label_ = new views::Label(base::string16(), GetFontList()); | 167 ev_label_ = new views::Label(base::string16(), GetFontList()); |
168 ev_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 168 ev_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
169 ev_label_->SetElideBehavior(gfx::TRUNCATE); | 169 ev_label_->SetElideBehavior(gfx::NO_ELIDE); |
170 AddChildView(ev_label_); | 170 AddChildView(ev_label_); |
171 | 171 |
172 host_label_ = new views::Label(base::string16(), GetFontList()); | 172 host_label_ = new views::Label(base::string16(), GetFontList()); |
173 host_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 173 host_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
174 host_label_->SetElideBehavior(gfx::TRUNCATE); | 174 host_label_->SetElideBehavior(gfx::NO_ELIDE); |
175 AddChildView(host_label_); | 175 AddChildView(host_label_); |
176 | 176 |
177 fade_in_animation_.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN); | 177 fade_in_animation_.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN); |
178 fade_in_animation_.SetSlideDuration(175); | 178 fade_in_animation_.SetSlideDuration(175); |
179 | 179 |
180 // Ensure |pressed_text_color_| and |background_colors_| are initialized. | 180 // Ensure |pressed_text_color_| and |background_colors_| are initialized. |
181 SetBorderImages(kNormalImages); | 181 SetBorderImages(kNormalImages); |
182 } | 182 } |
183 | 183 |
184 OriginChipView::~OriginChipView() { | 184 OriginChipView::~OriginChipView() { |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 | 410 |
411 // Note: When OnSafeBrowsingHit would be called, OnSafeBrowsingMatch will | 411 // Note: When OnSafeBrowsingHit would be called, OnSafeBrowsingMatch will |
412 // have already been called. | 412 // have already been called. |
413 void OriginChipView::OnSafeBrowsingHit( | 413 void OriginChipView::OnSafeBrowsingHit( |
414 const SafeBrowsingUIManager::UnsafeResource& resource) {} | 414 const SafeBrowsingUIManager::UnsafeResource& resource) {} |
415 | 415 |
416 void OriginChipView::OnSafeBrowsingMatch( | 416 void OriginChipView::OnSafeBrowsingMatch( |
417 const SafeBrowsingUIManager::UnsafeResource& resource) { | 417 const SafeBrowsingUIManager::UnsafeResource& resource) { |
418 OnChanged(); | 418 OnChanged(); |
419 } | 419 } |
OLD | NEW |