| 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/suggested_text_view.h" | 5 #include "chrome/browser/ui/views/location_bar/suggested_text_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/instant/instant_controller.h" | 7 #include "chrome/browser/instant/instant_controller.h" |
| 8 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 8 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
| 9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 10 #include "ui/base/animation/multi_animation.h" | 10 #include "ui/base/animation/multi_animation.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 SchedulePaint(); | 67 SchedulePaint(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void SuggestedTextView::AnimationCanceled(const ui::Animation* animation) { | 70 void SuggestedTextView::AnimationCanceled(const ui::Animation* animation) { |
| 71 } | 71 } |
| 72 | 72 |
| 73 ui::Animation* SuggestedTextView::CreateAnimation() { | 73 ui::Animation* SuggestedTextView::CreateAnimation() { |
| 74 ui::MultiAnimation::Parts parts; | 74 ui::MultiAnimation::Parts parts; |
| 75 parts.push_back(ui::MultiAnimation::Part( | 75 parts.push_back(ui::MultiAnimation::Part( |
| 76 InstantController::kAutoCommitPauseTimeMS, ui::Tween::ZERO)); | 76 InstantController::kInlineAutocompletePauseTimeMS, ui::Tween::ZERO)); |
| 77 parts.push_back(ui::MultiAnimation::Part( | 77 parts.push_back(ui::MultiAnimation::Part( |
| 78 InstantController::kAutoCommitFadeInTimeMS, ui::Tween::EASE_IN)); | 78 InstantController::kInlineAutocompleteFadeInTimeMS, ui::Tween::EASE_IN)); |
| 79 ui::MultiAnimation* animation = new ui::MultiAnimation(parts); | 79 ui::MultiAnimation* animation = new ui::MultiAnimation(parts); |
| 80 animation->set_delegate(this); | 80 animation->set_delegate(this); |
| 81 animation->set_continuous(false); | 81 animation->set_continuous(false); |
| 82 return animation; | 82 return animation; |
| 83 } | 83 } |
| 84 | 84 |
| 85 void SuggestedTextView::UpdateBackgroundColor() { | 85 void SuggestedTextView::UpdateBackgroundColor() { |
| 86 if (!animation_.get()) { | 86 if (!animation_.get()) { |
| 87 // Background only painted while animating. | 87 // Background only painted while animating. |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 | 90 |
| 91 double value = animation_->GetCurrentValue(); | 91 double value = animation_->GetCurrentValue(); |
| 92 SkColor bg_color = LocationBarView::GetColor(ToolbarModel::NONE, | 92 SkColor bg_color = LocationBarView::GetColor(ToolbarModel::NONE, |
| 93 LocationBarView::BACKGROUND); | 93 LocationBarView::BACKGROUND); |
| 94 #if defined(OS_WIN) | 94 #if defined(OS_WIN) |
| 95 SkColor s_color = color_utils::GetSysSkColor(COLOR_HIGHLIGHT); | 95 SkColor s_color = color_utils::GetSysSkColor(COLOR_HIGHLIGHT); |
| 96 #else | 96 #else |
| 97 // TODO(sky): fix me. | 97 // TODO(sky): fix me. |
| 98 NOTIMPLEMENTED(); | 98 NOTIMPLEMENTED(); |
| 99 SkColor s_color = SK_ColorLTGRAY; | 99 SkColor s_color = SK_ColorLTGRAY; |
| 100 #endif | 100 #endif |
| 101 bg_color_ = color_utils::AlphaBlend(s_color, bg_color, | 101 bg_color_ = color_utils::AlphaBlend(s_color, bg_color, |
| 102 ui::Tween::ValueBetween(value, 0, 255)); | 102 ui::Tween::ValueBetween(value, 0, 255)); |
| 103 } | 103 } |
| OLD | NEW |