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/instant/instant_controller.h" | 7 #include "chrome/browser/instant/instant_controller.h" |
8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
9 #include "gfx/canvas.h" | 9 #include "gfx/canvas.h" |
10 #include "gfx/color_utils.h" | 10 #include "gfx/color_utils.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 void SuggestedTextView::PaintBackground(gfx::Canvas* canvas) { | 40 void SuggestedTextView::PaintBackground(gfx::Canvas* canvas) { |
41 if (!animation_.get() || animation_->GetCurrentValue() == 0) | 41 if (!animation_.get() || animation_->GetCurrentValue() == 0) |
42 return; | 42 return; |
43 | 43 |
44 // TODO(sky): these numbers need to come from the edit. | 44 // TODO(sky): these numbers need to come from the edit. |
45 canvas->FillRectInt(bg_color_, 0, 2, width(), height() - 5); | 45 canvas->FillRectInt(bg_color_, 0, 2, width(), height() - 5); |
46 } | 46 } |
47 | 47 |
48 void SuggestedTextView::AnimationEnded(const ui::Animation* animation) { | 48 void SuggestedTextView::AnimationEnded(const ui::Animation* animation) { |
49 location_bar_->OnCommitSuggestedText(); | 49 location_bar_->OnCommitSuggestedText(false); |
50 } | 50 } |
51 | 51 |
52 void SuggestedTextView::AnimationProgressed(const ui::Animation* animation) { | 52 void SuggestedTextView::AnimationProgressed(const ui::Animation* animation) { |
53 UpdateBackgroundColor(); | 53 UpdateBackgroundColor(); |
54 | 54 |
55 SkColor fg_color = LocationBarView::GetColor( | 55 SkColor fg_color = LocationBarView::GetColor( |
56 ToolbarModel::NONE, LocationBarView::DEEMPHASIZED_TEXT); | 56 ToolbarModel::NONE, LocationBarView::DEEMPHASIZED_TEXT); |
57 SkColor sel_fg_color = LocationBarView::GetColor( | 57 SkColor sel_fg_color = LocationBarView::GetColor( |
58 ToolbarModel::NONE, LocationBarView::SELECTED_TEXT); | 58 ToolbarModel::NONE, LocationBarView::SELECTED_TEXT); |
59 SetColor(color_utils::AlphaBlend( | 59 SetColor(color_utils::AlphaBlend( |
(...skipping 30 matching lines...) Expand all Loading... |
90 #if defined(OS_WIN) | 90 #if defined(OS_WIN) |
91 SkColor s_color = color_utils::GetSysSkColor(COLOR_HIGHLIGHT); | 91 SkColor s_color = color_utils::GetSysSkColor(COLOR_HIGHLIGHT); |
92 #else | 92 #else |
93 // TODO(sky): fix me. | 93 // TODO(sky): fix me. |
94 NOTIMPLEMENTED(); | 94 NOTIMPLEMENTED(); |
95 SkColor s_color = SK_ColorLTGRAY; | 95 SkColor s_color = SK_ColorLTGRAY; |
96 #endif | 96 #endif |
97 bg_color_ = color_utils::AlphaBlend(s_color, bg_color, | 97 bg_color_ = color_utils::AlphaBlend(s_color, bg_color, |
98 ui::Tween::ValueBetween(value, 0, 255)); | 98 ui::Tween::ValueBetween(value, 0, 255)); |
99 } | 99 } |
OLD | NEW |