| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 static const int kBackgroundImages[] = | 54 static const int kBackgroundImages[] = |
| 55 IMAGE_GRID(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE); | 55 IMAGE_GRID(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE); |
| 56 SetBackgroundImageGrid(kBackgroundImages); | 56 SetBackgroundImageGrid(kBackgroundImages); |
| 57 } | 57 } |
| 58 | 58 |
| 59 image()->SetHorizontalAlignment(base::i18n::IsRTL() | 59 image()->SetHorizontalAlignment(base::i18n::IsRTL() |
| 60 ? views::ImageView::TRAILING | 60 ? views::ImageView::TRAILING |
| 61 : views::ImageView::LEADING); | 61 : views::ImageView::LEADING); |
| 62 image()->set_interactive(true); | 62 image()->set_interactive(true); |
| 63 image()->EnableCanvasFlippingForRTLUI(true); | 63 image()->EnableCanvasFlippingForRTLUI(true); |
| 64 image()->SetAccessibilityFocusable(true); | 64 image()->SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); |
| 65 label()->SetElideBehavior(gfx::NO_ELIDE); | 65 label()->SetElideBehavior(gfx::NO_ELIDE); |
| 66 label()->SetVisible(false); | 66 label()->SetVisible(false); |
| 67 | 67 |
| 68 slide_animator_.SetSlideDuration(kAnimationDurationMS); | 68 slide_animator_.SetSlideDuration(kAnimationDurationMS); |
| 69 slide_animator_.SetTweenType(gfx::Tween::LINEAR); | 69 slide_animator_.SetTweenType(gfx::Tween::LINEAR); |
| 70 } | 70 } |
| 71 | 71 |
| 72 ContentSettingImageView::~ContentSettingImageView() { | 72 ContentSettingImageView::~ContentSettingImageView() { |
| 73 if (bubble_view_ && bubble_view_->GetWidget()) | 73 if (bubble_view_ && bubble_view_->GetWidget()) |
| 74 bubble_view_->GetWidget()->RemoveObserver(this); | 74 bubble_view_->GetWidget()->RemoveObserver(this); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 bool visible) { | 279 bool visible) { |
| 280 // |widget| is a bubble that has just got shown / hidden. | 280 // |widget| is a bubble that has just got shown / hidden. |
| 281 if (!visible && !label()->visible()) | 281 if (!visible && !label()->visible()) |
| 282 ink_drop_delegate_->OnAction(views::InkDropState::DEACTIVATED); | 282 ink_drop_delegate_->OnAction(views::InkDropState::DEACTIVATED); |
| 283 } | 283 } |
| 284 | 284 |
| 285 void ContentSettingImageView::UpdateImage() { | 285 void ContentSettingImageView::UpdateImage() { |
| 286 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); | 286 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); |
| 287 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); | 287 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); |
| 288 } | 288 } |
| OLD | NEW |