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 "base/memory/ptr_util.h" |
10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
11 #include "ui/app_list/app_list_constants.h" | 12 #include "ui/app_list/app_list_constants.h" |
12 #include "ui/app_list/app_list_model.h" | 13 #include "ui/app_list/app_list_model.h" |
13 #include "ui/app_list/app_list_switches.h" | 14 #include "ui/app_list/app_list_switches.h" |
14 #include "ui/app_list/app_list_view_delegate.h" | 15 #include "ui/app_list/app_list_view_delegate.h" |
15 #include "ui/app_list/resources/grit/app_list_resources.h" | 16 #include "ui/app_list/resources/grit/app_list_resources.h" |
16 #include "ui/app_list/search_box_model.h" | 17 #include "ui/app_list/search_box_model.h" |
17 #include "ui/app_list/speech_ui_model.h" | 18 #include "ui/app_list/speech_ui_model.h" |
18 #include "ui/app_list/views/app_list_menu_views.h" | 19 #include "ui/app_list/views/app_list_menu_views.h" |
19 #include "ui/app_list/views/contents_view.h" | 20 #include "ui/app_list/views/contents_view.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // does not generate ContentsChanged() notification. | 216 // does not generate ContentsChanged() notification. |
216 UpdateModel(); | 217 UpdateModel(); |
217 NotifyQueryChanged(); | 218 NotifyQueryChanged(); |
218 } | 219 } |
219 | 220 |
220 void SearchBoxView::InvalidateMenu() { | 221 void SearchBoxView::InvalidateMenu() { |
221 menu_.reset(); | 222 menu_.reset(); |
222 } | 223 } |
223 | 224 |
224 void SearchBoxView::SetShadow(const gfx::ShadowValue& shadow) { | 225 void SearchBoxView::SetShadow(const gfx::ShadowValue& shadow) { |
225 SetBorder(make_scoped_ptr(new views::ShadowBorder(shadow))); | 226 SetBorder(base::WrapUnique(new views::ShadowBorder(shadow))); |
226 Layout(); | 227 Layout(); |
227 } | 228 } |
228 | 229 |
229 gfx::Rect SearchBoxView::GetViewBoundsForSearchBoxContentsBounds( | 230 gfx::Rect SearchBoxView::GetViewBoundsForSearchBoxContentsBounds( |
230 const gfx::Rect& rect) const { | 231 const gfx::Rect& rect) const { |
231 gfx::Rect view_bounds = rect; | 232 gfx::Rect view_bounds = rect; |
232 view_bounds.Inset(-GetInsets()); | 233 view_bounds.Inset(-GetInsets()); |
233 return view_bounds; | 234 return view_bounds; |
234 } | 235 } |
235 | 236 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 NotifyQueryChanged(); | 467 NotifyQueryChanged(); |
467 } | 468 } |
468 | 469 |
469 void SearchBoxView::OnSpeechRecognitionStateChanged( | 470 void SearchBoxView::OnSpeechRecognitionStateChanged( |
470 SpeechRecognitionState new_state) { | 471 SpeechRecognitionState new_state) { |
471 SpeechRecognitionButtonPropChanged(); | 472 SpeechRecognitionButtonPropChanged(); |
472 SchedulePaint(); | 473 SchedulePaint(); |
473 } | 474 } |
474 | 475 |
475 } // namespace app_list | 476 } // namespace app_list |
OLD | NEW |