Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: chrome/browser/ui/views/location_bar/content_setting_image_view.cc

Issue 6154001: Move animation code to new ui/base/animation directory.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698