| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/content_setting_image_view.h" | 5 #include "chrome/browser/ui/views/location_bar/content_setting_image_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/themes/theme_properties.h" | 8 #include "chrome/browser/themes/theme_properties.h" |
| 9 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 9 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| 10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" | 10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 gfx::Point ContentSettingImageView::CalculateInkDropCenter() const { | 254 gfx::Point ContentSettingImageView::CalculateInkDropCenter() const { |
| 255 return GetLocalBounds().CenterPoint(); | 255 return GetLocalBounds().CenterPoint(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 bool ContentSettingImageView::ShouldShowInkDropHover() const { | 258 bool ContentSettingImageView::ShouldShowInkDropHover() const { |
| 259 // location bar views don't show hover effect. | 259 // location bar views don't show hover effect. |
| 260 return false; | 260 return false; |
| 261 } | 261 } |
| 262 | 262 |
| 263 SkColor ContentSettingImageView::GetInkDropBaseColor() const { |
| 264 return GetTextColor(); |
| 265 } |
| 266 |
| 263 void ContentSettingImageView::OnWidgetDestroying(views::Widget* widget) { | 267 void ContentSettingImageView::OnWidgetDestroying(views::Widget* widget) { |
| 264 DCHECK(bubble_view_); | 268 DCHECK(bubble_view_); |
| 265 DCHECK_EQ(bubble_view_->GetWidget(), widget); | 269 DCHECK_EQ(bubble_view_->GetWidget(), widget); |
| 266 widget->RemoveObserver(this); | 270 widget->RemoveObserver(this); |
| 267 bubble_view_ = nullptr; | 271 bubble_view_ = nullptr; |
| 268 | 272 |
| 269 if (pause_animation_) { | 273 if (pause_animation_) { |
| 270 slide_animator_.Reset(pause_animation_state_); | 274 slide_animator_.Reset(pause_animation_state_); |
| 271 pause_animation_ = false; | 275 pause_animation_ = false; |
| 272 slide_animator_.Show(); | 276 slide_animator_.Show(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 } | 308 } |
| 305 | 309 |
| 306 void ContentSettingImageView::UpdateImage() { | 310 void ContentSettingImageView::UpdateImage() { |
| 307 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); | 311 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); |
| 308 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); | 312 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); |
| 309 } | 313 } |
| 310 | 314 |
| 311 bool ContentSettingImageView::IsBubbleShowing() const { | 315 bool ContentSettingImageView::IsBubbleShowing() const { |
| 312 return bubble_view_ != nullptr; | 316 return bubble_view_ != nullptr; |
| 313 } | 317 } |
| OLD | NEW |