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 "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" |
11 #include "ui/app_list/search_box_model.h" | 11 #include "ui/app_list/search_box_model.h" |
12 #include "ui/app_list/views/app_list_menu_views.h" | 12 #include "ui/app_list/views/app_list_menu_views.h" |
13 #include "ui/app_list/views/search_box_view_delegate.h" | 13 #include "ui/app_list/views/search_box_view_delegate.h" |
14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/events/event.h" | 15 #include "ui/events/event.h" |
16 #include "ui/views/controls/button/menu_button.h" | 16 #include "ui/views/controls/button/menu_button.h" |
17 #include "ui/views/controls/image_view.h" | 17 #include "ui/views/controls/image_view.h" |
18 #include "ui/views/controls/textfield/textfield.h" | 18 #include "ui/views/controls/textfield/textfield.h" |
19 | 19 |
20 namespace app_list { | 20 namespace app_list { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 const int kPadding = 14; | 24 const int kPadding = 14; |
25 const int kIconDimension = 32; | 25 const int kIconDimension = 32; |
26 const int kPreferredWidth = 360; | 26 const int kPreferredWidth = 360; |
27 const int kPreferredHeight = 48; | 27 const int kPreferredHeight = 48; |
| 28 #if !defined(OS_CHROMEOS) |
28 const int kMenuButtonDimension = 29; | 29 const int kMenuButtonDimension = 29; |
| 30 #endif |
29 | 31 |
30 const SkColor kHintTextColor = SkColorSetRGB(0xA0, 0xA0, 0xA0); | 32 const SkColor kHintTextColor = SkColorSetRGB(0xA0, 0xA0, 0xA0); |
31 | 33 |
32 // Menu offset relative to the bottom-right corner of the menu button. | 34 // Menu offset relative to the bottom-right corner of the menu button. |
33 const int kMenuYOffsetFromButton = -4; | 35 const int kMenuYOffsetFromButton = -4; |
34 const int kMenuXOffsetFromButton = -7; | 36 const int kMenuXOffsetFromButton = -7; |
35 | 37 |
36 } // namespace | 38 } // namespace |
37 | 39 |
38 SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate, | 40 SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 void SearchBoxView::SelectionModelChanged() { | 181 void SearchBoxView::SelectionModelChanged() { |
180 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); | 182 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); |
181 } | 183 } |
182 | 184 |
183 void SearchBoxView::TextChanged() { | 185 void SearchBoxView::TextChanged() { |
184 search_box_->SetText(model_->search_box()->text()); | 186 search_box_->SetText(model_->search_box()->text()); |
185 NotifyQueryChanged(); | 187 NotifyQueryChanged(); |
186 } | 188 } |
187 | 189 |
188 } // namespace app_list | 190 } // namespace app_list |
OLD | NEW |