OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // The fraction of the animation we'll spend animating the string into view, and | 41 // The fraction of the animation we'll spend animating the string into view, and |
42 // then again animating it closed - total animation (slide out, show, then | 42 // then again animating it closed - total animation (slide out, show, then |
43 // slide in) is 1.0. | 43 // slide in) is 1.0. |
44 const double kAnimatingFraction = kOpenTimeMs * 1.0 / kMoveTimeMs; | 44 const double kAnimatingFraction = kOpenTimeMs * 1.0 / kMoveTimeMs; |
45 } | 45 } |
46 | 46 |
47 ContentSettingImageView::ContentSettingImageView( | 47 ContentSettingImageView::ContentSettingImageView( |
48 ContentSettingsType content_type, | 48 ContentSettingsType content_type, |
49 LocationBarView* parent, | 49 LocationBarView* parent, |
50 Profile* profile) | 50 Profile* profile) |
51 : LinearAnimation(kMoveTimeMs, kFrameRateHz, NULL), | 51 : ui::LinearAnimation(kMoveTimeMs, kFrameRateHz, NULL), |
52 content_setting_image_model_( | 52 content_setting_image_model_( |
53 ContentSettingImageModel::CreateContentSettingImageModel( | 53 ContentSettingImageModel::CreateContentSettingImageModel( |
54 content_type)), | 54 content_type)), |
55 parent_(parent), | 55 parent_(parent), |
56 profile_(profile), | 56 profile_(profile), |
57 info_bubble_(NULL), | 57 info_bubble_(NULL), |
58 animation_in_progress_(false), | 58 animation_in_progress_(false), |
59 text_size_(0), | 59 text_size_(0), |
60 visible_text_size_(0) { | 60 visible_text_size_(0) { |
61 SetHorizontalAlignment(ImageView::LEADING); | 61 SetHorizontalAlignment(ImageView::LEADING); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } else if (state > (1.0 - kAnimatingFraction)) { | 235 } else if (state > (1.0 - kAnimatingFraction)) { |
236 visible_text_size_ = static_cast<int>(text_size_ * (1.0 - state) / | 236 visible_text_size_ = static_cast<int>(text_size_ * (1.0 - state) / |
237 kAnimatingFraction); | 237 kAnimatingFraction); |
238 } else { | 238 } else { |
239 visible_text_size_ = text_size_; | 239 visible_text_size_ = text_size_; |
240 } | 240 } |
241 parent_->Layout(); | 241 parent_->Layout(); |
242 parent_->SchedulePaint(); | 242 parent_->SchedulePaint(); |
243 } | 243 } |
244 | 244 |
OLD | NEW |