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/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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 parent_->Layout(); | 146 parent_->Layout(); |
147 parent_->SchedulePaint(); | 147 parent_->SchedulePaint(); |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 void ContentSettingImageView::AnimationCanceled( | 151 void ContentSettingImageView::AnimationCanceled( |
152 const gfx::Animation* animation) { | 152 const gfx::Animation* animation) { |
153 AnimationEnded(animation); | 153 AnimationEnded(animation); |
154 } | 154 } |
155 | 155 |
156 gfx::Size ContentSettingImageView::GetPreferredSize() { | 156 gfx::Size ContentSettingImageView::GetPreferredSize() const { |
157 // Height will be ignored by the LocationBarView. | 157 // Height will be ignored by the LocationBarView. |
158 gfx::Size size(icon_->GetPreferredSize()); | 158 gfx::Size size(icon_->GetPreferredSize()); |
159 if (background_showing()) { | 159 if (background_showing()) { |
160 double state = slide_animator_.GetCurrentValue(); | 160 double state = slide_animator_.GetCurrentValue(); |
161 // The fraction of the animation we'll spend animating the string into view, | 161 // The fraction of the animation we'll spend animating the string into view, |
162 // which is also the fraction we'll spend animating it closed; total | 162 // which is also the fraction we'll spend animating it closed; total |
163 // animation (slide out, show, then slide in) is 1.0. | 163 // animation (slide out, show, then slide in) is 1.0. |
164 const double kOpenFraction = | 164 const double kOpenFraction = |
165 static_cast<double>(kOpenTimeMS) / kAnimationDurationMS; | 165 static_cast<double>(kOpenTimeMS) / kAnimationDurationMS; |
166 double size_fraction = 1.0; | 166 double size_fraction = 1.0; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 parent_->delegate()->CreateViewsBubble(new ContentSettingBubbleContents( | 243 parent_->delegate()->CreateViewsBubble(new ContentSettingBubbleContents( |
244 ContentSettingBubbleModel::CreateContentSettingBubbleModel( | 244 ContentSettingBubbleModel::CreateContentSettingBubbleModel( |
245 parent_->delegate()->GetContentSettingBubbleModelDelegate(), | 245 parent_->delegate()->GetContentSettingBubbleModelDelegate(), |
246 web_contents, parent_->profile(), | 246 web_contents, parent_->profile(), |
247 content_setting_image_model_->get_content_settings_type()), | 247 content_setting_image_model_->get_content_settings_type()), |
248 this, views::BubbleBorder::TOP_RIGHT)); | 248 this, views::BubbleBorder::TOP_RIGHT)); |
249 bubble_widget_->AddObserver(this); | 249 bubble_widget_->AddObserver(this); |
250 bubble_widget_->Show(); | 250 bubble_widget_->Show(); |
251 } | 251 } |
252 } | 252 } |
OLD | NEW |