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

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

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/app_list/views/search_box_view.h ('k') | ui/app_list/views/search_result_list_view.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 "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 gfx::Size SearchBoxView::GetPreferredSize() { 111 gfx::Size SearchBoxView::GetPreferredSize() const {
112 return gfx::Size(kPreferredWidth, kPreferredHeight); 112 return gfx::Size(kPreferredWidth, kPreferredHeight);
113 } 113 }
114 114
115 void SearchBoxView::Layout() { 115 void SearchBoxView::Layout() {
116 gfx::Rect rect(GetContentsBounds()); 116 gfx::Rect rect(GetContentsBounds());
117 if (rect.IsEmpty()) 117 if (rect.IsEmpty())
118 return; 118 return;
119 119
120 gfx::Rect icon_frame(rect); 120 gfx::Rect icon_frame(rect);
121 icon_frame.set_width(kIconDimension + 2 * kPadding); 121 icon_frame.set_width(kIconDimension + 2 * kPadding);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 NotifyQueryChanged(); 253 NotifyQueryChanged();
254 } 254 }
255 255
256 void SearchBoxView::OnSpeechRecognitionStateChanged( 256 void SearchBoxView::OnSpeechRecognitionStateChanged(
257 SpeechRecognitionState new_state) { 257 SpeechRecognitionState new_state) {
258 SpeechRecognitionButtonPropChanged(); 258 SpeechRecognitionButtonPropChanged();
259 SchedulePaint(); 259 SchedulePaint();
260 } 260 }
261 261
262 } // namespace app_list 262 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/search_box_view.h ('k') | ui/app_list/views/search_result_list_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698