Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: ui/app_list/views/search_box_view.cc

Issue 1534303002: CustomButton cleanup: make protected members private, create accessors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dont move declaration randomly Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/views/app_list_item_view.cc ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_item_view.cc ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698