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

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

Issue 185623002: Add Hide and Show to the app list SearchBoxView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ares_contents_switcher
Patch Set: Created 6 years, 9 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
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 "grit/ui_resources.h" 9 #include "grit/ui_resources.h"
10 #include "ui/app_list/app_list_model.h" 10 #include "ui/app_list/app_list_model.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // Updates model and fires query changed manually because SetText() above 101 // Updates model and fires query changed manually because SetText() above
102 // does not generate ContentsChanged() notification. 102 // does not generate ContentsChanged() notification.
103 UpdateModel(); 103 UpdateModel();
104 NotifyQueryChanged(); 104 NotifyQueryChanged();
105 } 105 }
106 106
107 void SearchBoxView::InvalidateMenu() { 107 void SearchBoxView::InvalidateMenu() {
108 menu_.reset(); 108 menu_.reset();
109 } 109 }
110 110
111 void SearchBoxView::Show() {
112 SetVisible(true);
113 delegate_->SearchBoxVisibilityChanged(this);
114 }
115
116 void SearchBoxView::Hide() {
117 SetVisible(false);
118 delegate_->SearchBoxVisibilityChanged(this);
119 }
120
111 gfx::Size SearchBoxView::GetPreferredSize() { 121 gfx::Size SearchBoxView::GetPreferredSize() {
112 return gfx::Size(kPreferredWidth, kPreferredHeight); 122 return gfx::Size(kPreferredWidth, kPreferredHeight);
113 } 123 }
114 124
115 void SearchBoxView::Layout() { 125 void SearchBoxView::Layout() {
116 gfx::Rect rect(GetContentsBounds()); 126 gfx::Rect rect(GetContentsBounds());
117 if (rect.IsEmpty()) 127 if (rect.IsEmpty())
118 return; 128 return;
119 129
120 gfx::Rect icon_frame(rect); 130 gfx::Rect icon_frame(rect);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 NotifyQueryChanged(); 263 NotifyQueryChanged();
254 } 264 }
255 265
256 void SearchBoxView::OnSpeechRecognitionStateChanged( 266 void SearchBoxView::OnSpeechRecognitionStateChanged(
257 SpeechRecognitionState new_state) { 267 SpeechRecognitionState new_state) {
258 SpeechRecognitionButtonPropChanged(); 268 SpeechRecognitionButtonPropChanged();
259 SchedulePaint(); 269 SchedulePaint();
260 } 270 }
261 271
262 } // namespace app_list 272 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698