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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // state. | 96 // state. |
97 if (event.key_code() == ui::VKEY_SPACE) | 97 if (event.key_code() == ui::VKEY_SPACE) |
98 return false; | 98 return false; |
99 | 99 |
100 return CustomButton::OnKeyPressed(event); | 100 return CustomButton::OnKeyPressed(event); |
101 } | 101 } |
102 | 102 |
103 private: | 103 private: |
104 // views::View overrides: | 104 // views::View overrides: |
105 void OnPaintBackground(gfx::Canvas* canvas) override { | 105 void OnPaintBackground(gfx::Canvas* canvas) override { |
106 if (state_ == STATE_HOVERED || state_ == STATE_PRESSED || selected_) | 106 if (state() == STATE_HOVERED || state() == STATE_PRESSED || selected_) |
107 canvas->FillRect(gfx::Rect(size()), kSelectedColor); | 107 canvas->FillRect(gfx::Rect(size()), kSelectedColor); |
108 } | 108 } |
109 | 109 |
110 bool selected_; | 110 bool selected_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(SearchBoxImageButton); | 112 DISALLOW_COPY_AND_ASSIGN(SearchBoxImageButton); |
113 }; | 113 }; |
114 | 114 |
115 SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate, | 115 SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate, |
116 AppListViewDelegate* view_delegate) | 116 AppListViewDelegate* view_delegate) |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 NotifyQueryChanged(); | 462 NotifyQueryChanged(); |
463 } | 463 } |
464 | 464 |
465 void SearchBoxView::OnSpeechRecognitionStateChanged( | 465 void SearchBoxView::OnSpeechRecognitionStateChanged( |
466 SpeechRecognitionState new_state) { | 466 SpeechRecognitionState new_state) { |
467 SpeechRecognitionButtonPropChanged(); | 467 SpeechRecognitionButtonPropChanged(); |
468 SchedulePaint(); | 468 SchedulePaint(); |
469 } | 469 } |
470 | 470 |
471 } // namespace app_list | 471 } // namespace app_list |
OLD | NEW |