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