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 "chrome/browser/ui/app_list/search/omnibox_result.h" | 5 #include "chrome/browser/ui/app_list/search/omnibox_result.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 8 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 RecordHistogram(OMNIBOX_SEARCH_RESULT); | 127 RecordHistogram(OMNIBOX_SEARCH_RESULT); |
128 GURL url = match_.destination_url; | 128 GURL url = match_.destination_url; |
129 if (is_voice_query_ && | 129 if (is_voice_query_ && |
130 base::UTF16ToUTF8(match_.keyword) == kGoogleSearchKeyword) { | 130 base::UTF16ToUTF8(match_.keyword) == kGoogleSearchKeyword) { |
131 url = MakeGoogleSearchSpokenFeedbackUrl(url); | 131 url = MakeGoogleSearchSpokenFeedbackUrl(url); |
132 } | 132 } |
133 list_controller_->OpenURL(profile_, url, match_.transition, | 133 list_controller_->OpenURL(profile_, url, match_.transition, |
134 ui::DispositionFromEventFlags(event_flags)); | 134 ui::DispositionFromEventFlags(event_flags)); |
135 } | 135 } |
136 | 136 |
137 scoped_ptr<SearchResult> OmniboxResult::Duplicate() { | 137 scoped_ptr<SearchResult> OmniboxResult::Duplicate() const { |
138 return scoped_ptr<SearchResult>(new OmniboxResult(profile_, list_controller_, | 138 return scoped_ptr<SearchResult>(new OmniboxResult(profile_, list_controller_, |
139 autocomplete_controller_, | 139 autocomplete_controller_, |
140 is_voice_query_, match_)); | 140 is_voice_query_, match_)); |
141 } | 141 } |
142 | 142 |
143 void OmniboxResult::UpdateIcon() { | 143 void OmniboxResult::UpdateIcon() { |
144 BookmarkModel* bookmark_model = BookmarkModelFactory::GetForProfile(profile_); | 144 BookmarkModel* bookmark_model = BookmarkModelFactory::GetForProfile(profile_); |
145 bool is_bookmarked = | 145 bool is_bookmarked = |
146 bookmark_model && bookmark_model->IsBookmarked(match_.destination_url); | 146 bookmark_model && bookmark_model->IsBookmarked(match_.destination_url); |
147 int resource_id = is_bookmarked ? IDR_OMNIBOX_STAR | 147 int resource_id = is_bookmarked ? IDR_OMNIBOX_STAR |
(...skipping 10 matching lines...) Expand all Loading... |
158 set_title_tags(title_tags); | 158 set_title_tags(title_tags); |
159 | 159 |
160 set_details(match_.description); | 160 set_details(match_.description); |
161 SearchResult::Tags details_tags; | 161 SearchResult::Tags details_tags; |
162 ACMatchClassificationsToTags(match_.description, match_.description_class, | 162 ACMatchClassificationsToTags(match_.description, match_.description_class, |
163 &details_tags); | 163 &details_tags); |
164 set_details_tags(details_tags); | 164 set_details_tags(details_tags); |
165 } | 165 } |
166 | 166 |
167 } // namespace app_list | 167 } // namespace app_list |
OLD | NEW |