OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/home/app_list_view_delegate.h" | 5 #include "athena/home/app_list_view_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "athena/home/public/app_model_builder.h" | 10 #include "athena/home/public/app_model_builder.h" |
| 11 #include "athena/strings/grit/athena_strings.h" |
11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
12 #include "base/bind.h" | 13 #include "base/bind.h" |
13 #include "base/callback.h" | 14 #include "base/callback.h" |
14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
15 #include "base/strings/utf_string_conversions.h" | |
16 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
17 #include "ui/app_list/app_list_model.h" | 17 #include "ui/app_list/app_list_model.h" |
18 #include "ui/app_list/search_box_model.h" | 18 #include "ui/app_list/search_box_model.h" |
19 #include "ui/app_list/search_provider.h" | 19 #include "ui/app_list/search_provider.h" |
20 #include "ui/app_list/search_result.h" | 20 #include "ui/app_list/search_result.h" |
21 #include "ui/app_list/speech_ui_model.h" | 21 #include "ui/app_list/speech_ui_model.h" |
| 22 #include "ui/base/l10n/l10n_util.h" |
22 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
23 #include "ui/gfx/image/image_skia.h" | 24 #include "ui/gfx/image/image_skia.h" |
24 #include "ui/resources/grit/ui_resources.h" | 25 #include "ui/resources/grit/ui_resources.h" |
25 #include "ui/views/controls/image_view.h" | 26 #include "ui/views/controls/image_view.h" |
26 | 27 |
27 namespace athena { | 28 namespace athena { |
28 | 29 |
29 AppListViewDelegate::AppListViewDelegate(AppModelBuilder* model_builder) | 30 AppListViewDelegate::AppListViewDelegate(AppModelBuilder* model_builder) |
30 : model_(new app_list::AppListModel), | 31 : model_(new app_list::AppListModel), |
31 speech_ui_(new app_list::SpeechUIModel) { | 32 speech_ui_(new app_list::SpeechUIModel) { |
32 model_builder->PopulateApps(model_.get()); | 33 model_builder->PopulateApps(model_.get()); |
33 // TODO(mukai): get the text from the resources. | 34 model_->search_box()->SetHintText( |
34 model_->search_box()->SetHintText(base::ASCIIToUTF16("Search")); | 35 l10n_util::GetStringUTF16(IDS_ATHENA_SEARCH_BOX_HINT)); |
35 } | 36 } |
36 | 37 |
37 AppListViewDelegate::~AppListViewDelegate() { | 38 AppListViewDelegate::~AppListViewDelegate() { |
38 for (size_t i = 0; i < search_providers_.size(); ++i) | 39 for (size_t i = 0; i < search_providers_.size(); ++i) |
39 search_providers_[i]->set_result_changed_callback(base::Closure()); | 40 search_providers_[i]->set_result_changed_callback(base::Closure()); |
40 } | 41 } |
41 | 42 |
42 void AppListViewDelegate::RegisterSearchProvider( | 43 void AppListViewDelegate::RegisterSearchProvider( |
43 app_list::SearchProvider* search_provider) { | 44 app_list::SearchProvider* search_provider) { |
44 // Right now we allow only one provider. | 45 // Right now we allow only one provider. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 const app_list::AppListViewDelegate::Users& | 181 const app_list::AppListViewDelegate::Users& |
181 AppListViewDelegate::GetUsers() const { | 182 AppListViewDelegate::GetUsers() const { |
182 return users_; | 183 return users_; |
183 } | 184 } |
184 | 185 |
185 bool AppListViewDelegate::ShouldCenterWindow() const { | 186 bool AppListViewDelegate::ShouldCenterWindow() const { |
186 return true; | 187 return true; |
187 } | 188 } |
188 | 189 |
189 } // namespace athena | 190 } // namespace athena |
OLD | NEW |