| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/ui/app_list/search_builder.h" | 5 #include "chrome/browser/ui/app_list/search_builder.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 app_list::AppListModel::SearchResults* results, | 305 app_list::AppListModel::SearchResults* results, |
| 306 AppListControllerDelegate* list_controller) | 306 AppListControllerDelegate* list_controller) |
| 307 : profile_(profile), | 307 : profile_(profile), |
| 308 search_box_(search_box), | 308 search_box_(search_box), |
| 309 results_(results), | 309 results_(results), |
| 310 list_controller_(list_controller) { | 310 list_controller_(list_controller) { |
| 311 search_box_->SetHintText( | 311 search_box_->SetHintText( |
| 312 l10n_util::GetStringUTF16(IDS_SEARCH_BOX_HINT)); | 312 l10n_util::GetStringUTF16(IDS_SEARCH_BOX_HINT)); |
| 313 search_box_->SetIcon(*ui::ResourceBundle::GetSharedInstance(). | 313 search_box_->SetIcon(*ui::ResourceBundle::GetSharedInstance(). |
| 314 GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)); | 314 GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)); |
| 315 search_box_->SetUserIconEnabled(list_controller->ShouldShowUserIcon()); | |
| 316 search_box_->SetUserIcon(*ui::ResourceBundle::GetSharedInstance(). | |
| 317 GetImageSkiaNamed(IDR_APP_LIST_USER_INDICATOR)); | |
| 318 search_box_->SetUserIconTooltip(UTF8ToUTF16(profile_->GetProfileName())); | |
| 319 | 315 |
| 320 int providers = AutocompleteProvider::TYPE_EXTENSION_APP; | 316 int providers = AutocompleteProvider::TYPE_EXTENSION_APP; |
| 321 bool apps_only = true; | 317 bool apps_only = true; |
| 322 #if defined(OS_CHROMEOS) | 318 #if defined(OS_CHROMEOS) |
| 323 apps_only = CommandLine::ForCurrentProcess()->HasSwitch( | 319 apps_only = CommandLine::ForCurrentProcess()->HasSwitch( |
| 324 app_list::switches::kAppListShowAppsOnly); | 320 app_list::switches::kAppListShowAppsOnly); |
| 325 #endif | 321 #endif |
| 326 if (!apps_only) { | 322 if (!apps_only) { |
| 327 // TODO(xiyuan): Consider requesting fewer providers in the non-apps-only | 323 // TODO(xiyuan): Consider requesting fewer providers in the non-apps-only |
| 328 // case. | 324 // case. |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 result->Init(profile_, *it); | 445 result->Init(profile_, *it); |
| 450 results_->Add(result); | 446 results_->Add(result); |
| 451 } | 447 } |
| 452 } | 448 } |
| 453 | 449 |
| 454 void SearchBuilder::OnResultChanged(bool default_match_changed) { | 450 void SearchBuilder::OnResultChanged(bool default_match_changed) { |
| 455 // TODO(xiyuan): Handle default match properly. | 451 // TODO(xiyuan): Handle default match properly. |
| 456 const AutocompleteResult& ac_result = controller_->result(); | 452 const AutocompleteResult& ac_result = controller_->result(); |
| 457 PopulateFromACResult(ac_result); | 453 PopulateFromACResult(ac_result); |
| 458 } | 454 } |
| OLD | NEW |