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" |
11 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" | 11 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" |
12 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 12 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
13 #include "grit/theme_resources.h" | 13 #include "grit/theme_resources.h" |
14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
15 #include "ui/base/material_design/material_design_controller.h" | 15 #include "ui/base/material_design/material_design_controller.h" |
16 #include "ui/base/theme_provider.h" | 16 #include "ui/base/theme_provider.h" |
17 #include "ui/gfx/color_palette.h" | 17 #include "ui/gfx/color_palette.h" |
18 #include "ui/gfx/color_utils.h" | 18 #include "ui/gfx/color_utils.h" |
19 #include "ui/views/animation/button_ink_drop_delegate.h" | 19 #include "ui/views/animation/button_ink_drop_delegate.h" |
20 #include "ui/views/animation/ink_drop_hover.h" | |
21 #include "ui/views/controls/image_view.h" | 20 #include "ui/views/controls/image_view.h" |
22 #include "ui/views/controls/label.h" | 21 #include "ui/views/controls/label.h" |
23 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
24 | 23 |
25 namespace { | 24 namespace { |
26 // Time spent with animation fully open. | 25 // Time spent with animation fully open. |
27 const int kStayOpenTimeMS = 3200; | 26 const int kStayOpenTimeMS = 3200; |
28 } | 27 } |
29 | 28 |
30 | 29 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 bool visible) { | 278 bool visible) { |
280 // |widget| is a bubble that has just got shown / hidden. | 279 // |widget| is a bubble that has just got shown / hidden. |
281 if (!visible && !label()->visible()) | 280 if (!visible && !label()->visible()) |
282 ink_drop_delegate_->OnAction(views::InkDropState::DEACTIVATED); | 281 ink_drop_delegate_->OnAction(views::InkDropState::DEACTIVATED); |
283 } | 282 } |
284 | 283 |
285 void ContentSettingImageView::UpdateImage() { | 284 void ContentSettingImageView::UpdateImage() { |
286 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); | 285 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); |
287 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); | 286 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); |
288 } | 287 } |
OLD | NEW |