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