| 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 26 matching lines...) Expand all Loading... |
| 37 const gfx::FontList& font_list, | 37 const gfx::FontList& font_list, |
| 38 SkColor parent_background_color) | 38 SkColor parent_background_color) |
| 39 : IconLabelBubbleView(0, font_list, parent_background_color, false), | 39 : IconLabelBubbleView(0, font_list, parent_background_color, false), |
| 40 parent_(parent), | 40 parent_(parent), |
| 41 content_setting_image_model_(image_model), | 41 content_setting_image_model_(image_model), |
| 42 slide_animator_(this), | 42 slide_animator_(this), |
| 43 pause_animation_(false), | 43 pause_animation_(false), |
| 44 pause_animation_state_(0.0), | 44 pause_animation_state_(0.0), |
| 45 bubble_view_(nullptr), | 45 bubble_view_(nullptr), |
| 46 suppress_mouse_released_action_(false) { | 46 suppress_mouse_released_action_(false) { |
| 47 SetHasInkDrop(true); | 47 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 48 if (!ui::MaterialDesignController::IsModeMaterial()) { | 48 SetHasInkDrop(true); |
| 49 } else { |
| 49 static const int kBackgroundImages[] = | 50 static const int kBackgroundImages[] = |
| 50 IMAGE_GRID(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE); | 51 IMAGE_GRID(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE); |
| 51 SetBackgroundImageGrid(kBackgroundImages); | 52 SetBackgroundImageGrid(kBackgroundImages); |
| 52 } | 53 } |
| 53 | 54 |
| 54 image()->SetHorizontalAlignment(base::i18n::IsRTL() | 55 image()->SetHorizontalAlignment(base::i18n::IsRTL() |
| 55 ? views::ImageView::TRAILING | 56 ? views::ImageView::TRAILING |
| 56 : views::ImageView::LEADING); | 57 : views::ImageView::LEADING); |
| 57 image()->set_interactive(true); | 58 image()->set_interactive(true); |
| 58 image()->EnableCanvasFlippingForRTLUI(true); | 59 image()->EnableCanvasFlippingForRTLUI(true); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 bool visible) { | 275 bool visible) { |
| 275 // |widget| is a bubble that has just got shown / hidden. | 276 // |widget| is a bubble that has just got shown / hidden. |
| 276 if (!visible && !label()->visible()) | 277 if (!visible && !label()->visible()) |
| 277 AnimateInkDrop(views::InkDropState::DEACTIVATED); | 278 AnimateInkDrop(views::InkDropState::DEACTIVATED); |
| 278 } | 279 } |
| 279 | 280 |
| 280 void ContentSettingImageView::UpdateImage() { | 281 void ContentSettingImageView::UpdateImage() { |
| 281 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); | 282 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); |
| 282 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); | 283 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); |
| 283 } | 284 } |
| OLD | NEW |