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

Side by Side Diff: chrome/browser/ui/app_list/search/search_controller.cc

Issue 15745009: app_list: Add back the search icon and hint. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/search_controller.h" 5 #include "chrome/browser/ui/app_list/search/search_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "chrome/browser/ui/app_list/search/app_search_provider.h" 14 #include "chrome/browser/ui/app_list/search/app_search_provider.h"
15 #include "chrome/browser/ui/app_list/search/chrome_search_result.h" 15 #include "chrome/browser/ui/app_list/search/chrome_search_result.h"
16 #include "chrome/browser/ui/app_list/search/omnibox_provider.h" 16 #include "chrome/browser/ui/app_list/search/omnibox_provider.h"
17 #include "chrome/browser/ui/app_list/search/search_provider.h" 17 #include "chrome/browser/ui/app_list/search/search_provider.h"
18 #include "chrome/browser/ui/app_list/search/webstore_provider.h" 18 #include "chrome/browser/ui/app_list/search/webstore_provider.h"
19 #include "content/public/browser/user_metrics.h" 19 #include "content/public/browser/user_metrics.h"
20 #include "grit/generated_resources.h"
21 #include "grit/theme_resources.h"
20 #include "ui/app_list/search_box_model.h" 22 #include "ui/app_list/search_box_model.h"
23 #include "ui/base/l10n/l10n_util.h"
24 #include "ui/base/resource/resource_bundle.h"
21 25
22 namespace app_list { 26 namespace app_list {
23 27
24 SearchController::SearchController(Profile* profile, 28 SearchController::SearchController(Profile* profile,
25 SearchBoxModel* search_box, 29 SearchBoxModel* search_box,
26 AppListModel::SearchResults* results, 30 AppListModel::SearchResults* results,
27 AppListControllerDelegate* list_controller) 31 AppListControllerDelegate* list_controller)
28 : profile_(profile), 32 : profile_(profile),
29 search_box_(search_box), 33 search_box_(search_box),
30 list_controller_(list_controller), 34 list_controller_(list_controller),
31 dispatching_query_(false), 35 dispatching_query_(false),
32 mixer_(new Mixer(results)) { 36 mixer_(new Mixer(results)) {
33 Init(); 37 Init();
34 } 38 }
35 39
36 SearchController::~SearchController() {} 40 SearchController::~SearchController() {}
37 41
38 void SearchController::Init() { 42 void SearchController::Init() {
43 search_box_->SetHintText(
44 l10n_util::GetStringUTF16(IDS_SEARCH_BOX_HINT));
45 search_box_->SetIcon(*ui::ResourceBundle::GetSharedInstance().
46 GetImageSkiaNamed(IDR_OMNIBOX_SEARCH));
47
39 mixer_->Init(); 48 mixer_->Init();
40 49
41 AddProvider(Mixer::MAIN_GROUP, scoped_ptr<SearchProvider>( 50 AddProvider(Mixer::MAIN_GROUP, scoped_ptr<SearchProvider>(
42 new AppSearchProvider(profile_, list_controller_)).Pass()); 51 new AppSearchProvider(profile_, list_controller_)).Pass());
43 AddProvider(Mixer::OMNIBOX_GROUP, scoped_ptr<SearchProvider>( 52 AddProvider(Mixer::OMNIBOX_GROUP, scoped_ptr<SearchProvider>(
44 new OmniboxProvider(profile_)).Pass()); 53 new OmniboxProvider(profile_)).Pass());
45 AddProvider(Mixer::WEBSTORE_GROUP, scoped_ptr<SearchProvider>( 54 AddProvider(Mixer::WEBSTORE_GROUP, scoped_ptr<SearchProvider>(
46 new WebstoreProvider(profile_)).Pass()); 55 new WebstoreProvider(profile_)).Pass());
47 } 56 }
48 57
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 115 }
107 116
108 void SearchController::OnResultsChanged() { 117 void SearchController::OnResultsChanged() {
109 if (dispatching_query_) 118 if (dispatching_query_)
110 return; 119 return;
111 120
112 mixer_->MixAndPublish(); 121 mixer_->MixAndPublish();
113 } 122 }
114 123
115 } // namespace app_list 124 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698