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

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

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Replace in .mm files Created 4 years, 4 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ui::DispositionFromEventFlags(event_flags)); 159 ui::DispositionFromEventFlags(event_flags));
160 } 160 }
161 161
162 std::unique_ptr<SearchResult> OmniboxResult::Duplicate() const { 162 std::unique_ptr<SearchResult> OmniboxResult::Duplicate() const {
163 return std::unique_ptr<SearchResult>( 163 return std::unique_ptr<SearchResult>(
164 new OmniboxResult(profile_, list_controller_, 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 =
170 BookmarkModelFactory::GetForBrowserContext(profile_);
170 bool is_bookmarked = 171 bool is_bookmarked =
171 bookmark_model && bookmark_model->IsBookmarked(match_.destination_url); 172 bookmark_model && bookmark_model->IsBookmarked(match_.destination_url);
172 173
173 if (ui::MaterialDesignController::IsModeMaterial()) { 174 if (ui::MaterialDesignController::IsModeMaterial()) {
174 gfx::VectorIconId icon_id = is_bookmarked ? 175 gfx::VectorIconId icon_id = is_bookmarked ?
175 gfx::VectorIconId::OMNIBOX_STAR : 176 gfx::VectorIconId::OMNIBOX_STAR :
176 AutocompleteMatch::TypeToVectorIcon(match_.type); 177 AutocompleteMatch::TypeToVectorIcon(match_.type);
177 SetIcon(gfx::CreateVectorIcon(icon_id, 16, app_list::kIconColor)); 178 SetIcon(gfx::CreateVectorIcon(icon_id, 16, app_list::kIconColor));
178 return; 179 return;
179 } 180 }
(...skipping 12 matching lines...) Expand all
192 set_title_tags(title_tags); 193 set_title_tags(title_tags);
193 194
194 set_details(match_.description); 195 set_details(match_.description);
195 SearchResult::Tags details_tags; 196 SearchResult::Tags details_tags;
196 ACMatchClassificationsToTags(match_.description, match_.description_class, 197 ACMatchClassificationsToTags(match_.description, match_.description_class,
197 &details_tags); 198 &details_tags);
198 set_details_tags(details_tags); 199 set_details_tags(details_tags);
199 } 200 }
200 201
201 } // namespace app_list 202 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.cc ('k') | chrome/browser/ui/bookmarks/bookmark_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698