| 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_constants.h" | 9 #include "ui/app_list/app_list_constants.h" |
| 10 #include "ui/app_list/app_list_model.h" | 10 #include "ui/app_list/app_list_model.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 const int kBackgroundBorderWidth = 1; | 42 const int kBackgroundBorderWidth = 1; |
| 43 const int kBackgroundBorderBottomWidth = 1; | 43 const int kBackgroundBorderBottomWidth = 1; |
| 44 const int kBackgroundBorderCornerRadius = 2; | 44 const int kBackgroundBorderCornerRadius = 2; |
| 45 const SkColor kBackgroundBorderColor = SkColorSetRGB(0xEE, 0xEE, 0xEE); | 45 const SkColor kBackgroundBorderColor = SkColorSetRGB(0xEE, 0xEE, 0xEE); |
| 46 const SkColor kBackgroundBorderBottomColor = SkColorSetRGB(0xCC, 0xCC, 0xCC); | 46 const SkColor kBackgroundBorderBottomColor = SkColorSetRGB(0xCC, 0xCC, 0xCC); |
| 47 | 47 |
| 48 // A background that paints a solid white rounded rect with a thin grey border. | 48 // A background that paints a solid white rounded rect with a thin grey border. |
| 49 class ExperimentalSearchBoxBackground : public views::Background { | 49 class ExperimentalSearchBoxBackground : public views::Background { |
| 50 public: | 50 public: |
| 51 ExperimentalSearchBoxBackground() {} | 51 ExperimentalSearchBoxBackground() {} |
| 52 virtual ~ExperimentalSearchBoxBackground() {} | 52 ~ExperimentalSearchBoxBackground() override {} |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 // views::Background overrides: | 55 // views::Background overrides: |
| 56 virtual void Paint(gfx::Canvas* canvas, views::View* view) const override { | 56 void Paint(gfx::Canvas* canvas, views::View* view) const override { |
| 57 gfx::Rect bounds = view->GetContentsBounds(); | 57 gfx::Rect bounds = view->GetContentsBounds(); |
| 58 | 58 |
| 59 SkPaint paint; | 59 SkPaint paint; |
| 60 paint.setFlags(SkPaint::kAntiAlias_Flag); | 60 paint.setFlags(SkPaint::kAntiAlias_Flag); |
| 61 paint.setColor(kBackgroundBorderColor); | 61 paint.setColor(kBackgroundBorderColor); |
| 62 canvas->DrawRoundRect(bounds, kBackgroundBorderCornerRadius, paint); | 62 canvas->DrawRoundRect(bounds, kBackgroundBorderCornerRadius, paint); |
| 63 bounds.Inset(kBackgroundBorderWidth, | 63 bounds.Inset(kBackgroundBorderWidth, |
| 64 kBackgroundBorderWidth, | 64 kBackgroundBorderWidth, |
| 65 kBackgroundBorderWidth, | 65 kBackgroundBorderWidth, |
| 66 0); | 66 0); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 NotifyQueryChanged(); | 267 NotifyQueryChanged(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void SearchBoxView::OnSpeechRecognitionStateChanged( | 270 void SearchBoxView::OnSpeechRecognitionStateChanged( |
| 271 SpeechRecognitionState new_state) { | 271 SpeechRecognitionState new_state) { |
| 272 SpeechRecognitionButtonPropChanged(); | 272 SpeechRecognitionButtonPropChanged(); |
| 273 SchedulePaint(); | 273 SchedulePaint(); |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace app_list | 276 } // namespace app_list |
| OLD | NEW |