| 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 LocationBarView* parent) | 51 LocationBarView* parent) |
| 52 : content_setting_image_model_( | 52 : content_setting_image_model_( |
| 53 ContentSettingImageModel::CreateContentSettingImageModel( | 53 ContentSettingImageModel::CreateContentSettingImageModel( |
| 54 content_type)), | 54 content_type)), |
| 55 bubble_widget_(NULL), | 55 bubble_widget_(NULL), |
| 56 parent_(parent), | 56 parent_(parent), |
| 57 pause_animation_(false), | 57 pause_animation_(false), |
| 58 text_size_(0), | 58 text_size_(0), |
| 59 visible_text_size_(0) { | 59 visible_text_size_(0) { |
| 60 SetHorizontalAlignment(ImageView::LEADING); | 60 SetHorizontalAlignment(ImageView::LEADING); |
| 61 TouchableLocationBarView::Init(this); |
| 61 } | 62 } |
| 62 | 63 |
| 63 ContentSettingImageView::~ContentSettingImageView() { | 64 ContentSettingImageView::~ContentSettingImageView() { |
| 64 if (bubble_widget_) { | 65 if (bubble_widget_) { |
| 65 bubble_widget_->RemoveObserver(this); | 66 bubble_widget_->RemoveObserver(this); |
| 66 bubble_widget_ = NULL; | 67 bubble_widget_ = NULL; |
| 67 } | 68 } |
| 68 } | 69 } |
| 69 | 70 |
| 70 void ContentSettingImageView::UpdateFromWebContents(WebContents* web_contents) { | 71 void ContentSettingImageView::UpdateFromWebContents(WebContents* web_contents) { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 bubble_widget_->RemoveObserver(this); | 257 bubble_widget_->RemoveObserver(this); |
| 257 bubble_widget_ = NULL; | 258 bubble_widget_ = NULL; |
| 258 } | 259 } |
| 259 if (pause_animation_) { | 260 if (pause_animation_) { |
| 260 slide_animator_->Reset( | 261 slide_animator_->Reset( |
| 261 1.0 - (visible_text_size_ * kAnimatingFraction) / text_size_); | 262 1.0 - (visible_text_size_ * kAnimatingFraction) / text_size_); |
| 262 pause_animation_ = false; | 263 pause_animation_ = false; |
| 263 slide_animator_->Show(); | 264 slide_animator_->Show(); |
| 264 } | 265 } |
| 265 } | 266 } |
| 267 |
| 268 int ContentSettingImageView::GetBuiltInHorizontalPadding() const { |
| 269 return GetBuiltInHorizontalPaddingImpl(); |
| 270 } |
| 271 |
| OLD | NEW |