| 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 "ui/app_list/views/search_box_view.h" | 5 #include "ui/app_list/views/search_box_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/app_list/app_list_model.h" | 9 #include "ui/app_list/app_list_model.h" |
| 10 #include "ui/app_list/app_list_switches.h" | 10 #include "ui/app_list/app_list_switches.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 const SkColor kBackgroundBorderBottomColor = SkColorSetRGB(0xCC, 0xCC, 0xCC); | 45 const SkColor kBackgroundBorderBottomColor = SkColorSetRGB(0xCC, 0xCC, 0xCC); |
| 46 | 46 |
| 47 // A background that paints a solid white rounded rect with a thin grey border. | 47 // A background that paints a solid white rounded rect with a thin grey border. |
| 48 class SearchBoxBackground : public views::Background { | 48 class SearchBoxBackground : public views::Background { |
| 49 public: | 49 public: |
| 50 SearchBoxBackground() {} | 50 SearchBoxBackground() {} |
| 51 virtual ~SearchBoxBackground() {} | 51 virtual ~SearchBoxBackground() {} |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // views::Background overrides: | 54 // views::Background overrides: |
| 55 virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE { | 55 virtual void Paint(gfx::Canvas* canvas, views::View* view) const override { |
| 56 gfx::Rect bounds = view->GetContentsBounds(); | 56 gfx::Rect bounds = view->GetContentsBounds(); |
| 57 | 57 |
| 58 SkPaint paint; | 58 SkPaint paint; |
| 59 paint.setFlags(SkPaint::kAntiAlias_Flag); | 59 paint.setFlags(SkPaint::kAntiAlias_Flag); |
| 60 paint.setColor(kBackgroundBorderColor); | 60 paint.setColor(kBackgroundBorderColor); |
| 61 canvas->DrawRoundRect(bounds, kBackgroundBorderCornerRadius, paint); | 61 canvas->DrawRoundRect(bounds, kBackgroundBorderCornerRadius, paint); |
| 62 bounds.Inset(kBackgroundBorderWidth, | 62 bounds.Inset(kBackgroundBorderWidth, |
| 63 kBackgroundBorderWidth, | 63 kBackgroundBorderWidth, |
| 64 kBackgroundBorderWidth, | 64 kBackgroundBorderWidth, |
| 65 0); | 65 0); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 NotifyQueryChanged(); | 262 NotifyQueryChanged(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void SearchBoxView::OnSpeechRecognitionStateChanged( | 265 void SearchBoxView::OnSpeechRecognitionStateChanged( |
| 266 SpeechRecognitionState new_state) { | 266 SpeechRecognitionState new_state) { |
| 267 SpeechRecognitionButtonPropChanged(); | 267 SpeechRecognitionButtonPropChanged(); |
| 268 SchedulePaint(); | 268 SchedulePaint(); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace app_list | 271 } // namespace app_list |
| OLD | NEW |