Commit 924f86d5 authored by xiyuan@chromium.org's avatar xiyuan@chromium.org

app_list: Fix blank search results caused by whitespace.

BUG=138163
TEST=Verify whitespace query string does not trigger search results UI.

R=sky@chromium.org


Review URL: https://chromiumcodereview.appspot.com/10832232

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151072 0039d316-1c4b-4281-b951-d872f2087c98
parent 2d6a6656
......@@ -4,6 +4,7 @@
#include "ui/app_list/app_list_view.h"
#include "base/string_util.h"
#include "ui/app_list/app_list_bubble_border.h"
#include "ui/app_list/app_list_item_view.h"
#include "ui/app_list/app_list_model.h"
......@@ -175,7 +176,9 @@ gfx::Rect AppListView::GetBubbleBounds() {
}
void AppListView::QueryChanged(SearchBoxView* sender) {
bool should_show_search = !model_->search_box()->text().empty();
string16 query;
TrimWhitespace(model_->search_box()->text(), TRIM_ALL, &query);
bool should_show_search = !query.empty();
contents_view_->ShowSearchResults(should_show_search);
if (delegate_.get()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment