OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/speech_view.h" | 5 #include "ui/app_list/views/speech_view.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
9 #include "grit/ui_strings.h" | 9 #include "grit/ui_strings.h" |
10 #include "third_party/skia/include/core/SkPath.h" | 10 #include "third_party/skia/include/core/SkPath.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const SkColor kResultTextColor = SkColorSetRGB(178, 178, 178); | 45 const SkColor kResultTextColor = SkColorSetRGB(178, 178, 178); |
46 const SkColor kSoundLevelIndicatorColor = SkColorSetRGB(219, 219, 219); | 46 const SkColor kSoundLevelIndicatorColor = SkColorSetRGB(219, 219, 219); |
47 | 47 |
48 class SoundLevelIndicator : public views::View { | 48 class SoundLevelIndicator : public views::View { |
49 public: | 49 public: |
50 SoundLevelIndicator(); | 50 SoundLevelIndicator(); |
51 virtual ~SoundLevelIndicator(); | 51 virtual ~SoundLevelIndicator(); |
52 | 52 |
53 private: | 53 private: |
54 // Overridden from views::View: | 54 // Overridden from views::View: |
55 virtual void Paint(gfx::Canvas* canvas) OVERRIDE; | 55 virtual void Paint(gfx::Canvas* canvas, |
| 56 const views::CullSet& cull_set) OVERRIDE; |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(SoundLevelIndicator); | 58 DISALLOW_COPY_AND_ASSIGN(SoundLevelIndicator); |
58 }; | 59 }; |
59 | 60 |
60 SoundLevelIndicator::SoundLevelIndicator() {} | 61 SoundLevelIndicator::SoundLevelIndicator() {} |
61 | 62 |
62 SoundLevelIndicator::~SoundLevelIndicator() {} | 63 SoundLevelIndicator::~SoundLevelIndicator() {} |
63 | 64 |
64 void SoundLevelIndicator::Paint(gfx::Canvas* canvas) { | 65 void SoundLevelIndicator::Paint(gfx::Canvas* canvas, |
| 66 const views::CullSet& cull_set) { |
65 SkPaint paint; | 67 SkPaint paint; |
66 paint.setStyle(SkPaint::kFill_Style); | 68 paint.setStyle(SkPaint::kFill_Style); |
67 paint.setColor(kSoundLevelIndicatorColor); | 69 paint.setColor(kSoundLevelIndicatorColor); |
68 paint.setAntiAlias(true); | 70 paint.setAntiAlias(true); |
69 canvas->DrawCircle(bounds().CenterPoint(), width() / 2, paint); | 71 canvas->DrawCircle(bounds().CenterPoint(), width() / 2, paint); |
70 } | 72 } |
71 | 73 |
72 // MicButton is an image button with circular hit area. | 74 // MicButton is an image button with circular hit area. |
73 class MicButton : public views::ImageButton { | 75 class MicButton : public views::ImageButton { |
74 public: | 76 public: |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 resource_id = IDR_APP_LIST_SPEECH_MIC_ON; | 241 resource_id = IDR_APP_LIST_SPEECH_MIC_ON; |
240 else if (new_state == SPEECH_RECOGNITION_IN_SPEECH) | 242 else if (new_state == SPEECH_RECOGNITION_IN_SPEECH) |
241 resource_id = IDR_APP_LIST_SPEECH_MIC_RECORDING; | 243 resource_id = IDR_APP_LIST_SPEECH_MIC_RECORDING; |
242 | 244 |
243 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 245 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
244 mic_button_->SetImage(views::Button::STATE_NORMAL, | 246 mic_button_->SetImage(views::Button::STATE_NORMAL, |
245 bundle.GetImageSkiaNamed(resource_id)); | 247 bundle.GetImageSkiaNamed(resource_id)); |
246 } | 248 } |
247 | 249 |
248 } // namespace app_list | 250 } // namespace app_list |
OLD | NEW |