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

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

Issue 120983002: Update some uses of UTF conversions in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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
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"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 content::RecordAction(content::UserMetricsAction("AppList_Search")); 121 content::RecordAction(content::UserMetricsAction("AppList_Search"));
122 122
123 ChromeSearchResult* chrome_result = 123 ChromeSearchResult* chrome_result =
124 static_cast<app_list::ChromeSearchResult*>(result); 124 static_cast<app_list::ChromeSearchResult*>(result);
125 UMA_HISTOGRAM_ENUMERATION(kAppListSearchResultOpenTypeHistogram, 125 UMA_HISTOGRAM_ENUMERATION(kAppListSearchResultOpenTypeHistogram,
126 chrome_result->GetType(), 126 chrome_result->GetType(),
127 SEARCH_RESULT_TYPE_BOUNDARY); 127 SEARCH_RESULT_TYPE_BOUNDARY);
128 chrome_result->Open(event_flags); 128 chrome_result->Open(event_flags);
129 129
130 if (history_ && history_->IsReady()) { 130 if (history_ && history_->IsReady()) {
131 history_->AddLaunchEvent(UTF16ToUTF8(search_box_->text()), 131 history_->AddLaunchEvent(base::UTF16ToUTF8(search_box_->text()),
132 chrome_result->id()); 132 chrome_result->id());
133 } 133 }
134 } 134 }
135 135
136 void SearchController::InvokeResultAction(SearchResult* result, 136 void SearchController::InvokeResultAction(SearchResult* result,
137 int action_index, 137 int action_index,
138 int event_flags) { 138 int event_flags) {
139 // TODO(xiyuan): Hook up with user learning. 139 // TODO(xiyuan): Hook up with user learning.
140 static_cast<app_list::ChromeSearchResult*>(result)->InvokeAction( 140 static_cast<app_list::ChromeSearchResult*>(result)->InvokeAction(
141 action_index, event_flags); 141 action_index, event_flags);
142 } 142 }
143 143
144 void SearchController::AddProvider(Mixer::GroupId group, 144 void SearchController::AddProvider(Mixer::GroupId group,
145 scoped_ptr<SearchProvider> provider) { 145 scoped_ptr<SearchProvider> provider) {
146 provider->set_result_changed_callback(base::Bind( 146 provider->set_result_changed_callback(base::Bind(
147 &SearchController::OnResultsChanged, 147 &SearchController::OnResultsChanged,
148 base::Unretained(this))); 148 base::Unretained(this)));
149 mixer_->AddProviderToGroup(group, provider.get()); 149 mixer_->AddProviderToGroup(group, provider.get());
150 providers_.push_back(provider.release()); // Takes ownership. 150 providers_.push_back(provider.release()); // Takes ownership.
151 } 151 }
152 152
153 void SearchController::OnResultsChanged() { 153 void SearchController::OnResultsChanged() {
154 if (dispatching_query_) 154 if (dispatching_query_)
155 return; 155 return;
156 156
157 KnownResults known_results; 157 KnownResults known_results;
158 if (history_ && history_->IsReady()) { 158 if (history_ && history_->IsReady()) {
159 history_->GetKnownResults(UTF16ToUTF8(search_box_->text())) 159 history_->GetKnownResults(base::UTF16ToUTF8(search_box_->text()))
160 ->swap(known_results); 160 ->swap(known_results);
161 } 161 }
162 162
163 mixer_->MixAndPublish(known_results); 163 mixer_->MixAndPublish(known_results);
164 } 164 }
165 165
166 } // namespace app_list 166 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/search/people/people_result.cc ('k') | chrome/browser/ui/app_list/search/search_webstore_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698