| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/autocomplete/autocomplete_edit.h" | 7 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 8 #include "chrome/browser/instant/instant_controller.h" | 8 #include "chrome/browser/instant/instant_controller.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 29 matching lines...) Expand all Loading... |
| 40 LocationBarView::DEEMPHASIZED_TEXT)); | 40 LocationBarView::DEEMPHASIZED_TEXT)); |
| 41 SchedulePaint(); | 41 SchedulePaint(); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 void SuggestedTextView::OnPaintBackground(gfx::Canvas* canvas) { | 45 void SuggestedTextView::OnPaintBackground(gfx::Canvas* canvas) { |
| 46 if (!animation_.get() || animation_->GetCurrentValue() == 0) | 46 if (!animation_.get() || animation_->GetCurrentValue() == 0) |
| 47 return; | 47 return; |
| 48 | 48 |
| 49 // TODO(sky): these numbers need to come from the edit. | 49 // TODO(sky): these numbers need to come from the edit. |
| 50 canvas->FillRectInt(bg_color_, 0, 2, width(), height() - 5); | 50 canvas->FillRect(bg_color_, gfx::Rect(0, 2, width(), height() - 5)); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void SuggestedTextView::AnimationEnded(const ui::Animation* animation) { | 53 void SuggestedTextView::AnimationEnded(const ui::Animation* animation) { |
| 54 edit_model_->CommitSuggestedText(false); | 54 edit_model_->CommitSuggestedText(false); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void SuggestedTextView::AnimationProgressed(const ui::Animation* animation) { | 57 void SuggestedTextView::AnimationProgressed(const ui::Animation* animation) { |
| 58 UpdateBackgroundColor(); | 58 UpdateBackgroundColor(); |
| 59 | 59 |
| 60 SkColor fg_color = LocationBarView::GetColor( | 60 SkColor fg_color = LocationBarView::GetColor( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |