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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 void OmniboxResult::Open(int event_flags) { 152 void OmniboxResult::Open(int event_flags) {
153 RecordHistogram(OMNIBOX_SEARCH_RESULT); 153 RecordHistogram(OMNIBOX_SEARCH_RESULT);
154 GURL url = match_.destination_url; 154 GURL url = match_.destination_url;
155 if (is_voice_query_ && IsUrlGoogleSearch(url)) { 155 if (is_voice_query_ && IsUrlGoogleSearch(url)) {
156 url = MakeGoogleSearchSpokenFeedbackUrl(url); 156 url = MakeGoogleSearchSpokenFeedbackUrl(url);
157 } 157 }
158 list_controller_->OpenURL(profile_, url, match_.transition, 158 list_controller_->OpenURL(profile_, url, match_.transition,
159 ui::DispositionFromEventFlags(event_flags)); 159 ui::DispositionFromEventFlags(event_flags));
160 } 160 }
161 161
162 scoped_ptr<SearchResult> OmniboxResult::Duplicate() const { 162 std::unique_ptr<SearchResult> OmniboxResult::Duplicate() const {
163 return scoped_ptr<SearchResult>(new OmniboxResult(profile_, list_controller_, 163 return std::unique_ptr<SearchResult>(
164 autocomplete_controller_, 164 new OmniboxResult(profile_, list_controller_, autocomplete_controller_,
165 is_voice_query_, match_)); 165 is_voice_query_, match_));
166 } 166 }
167 167
168 void OmniboxResult::UpdateIcon() { 168 void OmniboxResult::UpdateIcon() {
169 BookmarkModel* bookmark_model = BookmarkModelFactory::GetForProfile(profile_); 169 BookmarkModel* bookmark_model = BookmarkModelFactory::GetForProfile(profile_);
170 bool is_bookmarked = 170 bool is_bookmarked =
171 bookmark_model && bookmark_model->IsBookmarked(match_.destination_url); 171 bookmark_model && bookmark_model->IsBookmarked(match_.destination_url);
172 172
173 if (ui::MaterialDesignController::IsModeMaterial()) { 173 if (ui::MaterialDesignController::IsModeMaterial()) {
174 gfx::VectorIconId icon_id = is_bookmarked ? 174 gfx::VectorIconId icon_id = is_bookmarked ?
175 gfx::VectorIconId::OMNIBOX_STAR : 175 gfx::VectorIconId::OMNIBOX_STAR :
(...skipping 16 matching lines...) Expand all
192 set_title_tags(title_tags); 192 set_title_tags(title_tags);
193 193
194 set_details(match_.description); 194 set_details(match_.description);
195 SearchResult::Tags details_tags; 195 SearchResult::Tags details_tags;
196 ACMatchClassificationsToTags(match_.description, match_.description_class, 196 ACMatchClassificationsToTags(match_.description, match_.description_class,
197 &details_tags); 197 &details_tags);
198 set_details_tags(details_tags); 198 set_details_tags(details_tags);
199 } 199 }
200 200
201 } // namespace app_list 201 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/search/omnibox_result.h ('k') | chrome/browser/ui/app_list/search/omnibox_result_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698