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

Unified Diff: chrome/browser/ui/app_list/search/omnibox_provider.cc

Issue 415053002: Remove AutocompleteMatch::is_starred (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/search/omnibox_provider.cc
diff --git a/chrome/browser/ui/app_list/search/omnibox_provider.cc b/chrome/browser/ui/app_list/search/omnibox_provider.cc
index b419af15e8569b74f0bcb1b255c695cb0c7e3a73..68aa562f2364d8bd324c43b8f91027d2b66d71dc 100644
--- a/chrome/browser/ui/app_list/search/omnibox_provider.cc
+++ b/chrome/browser/ui/app_list/search/omnibox_provider.cc
@@ -8,10 +8,12 @@
#include "chrome/browser/autocomplete/autocomplete_controller.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
+#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/app_list/search/chrome_search_result.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "components/autocomplete/autocomplete_input.h"
+#include "components/bookmarks/browser/bookmark_model.h"
#include "components/metrics/proto/omnibox_event.pb.h"
#include "grit/theme_resources.h"
#include "ui/base/resource/resource_bundle.h"
@@ -110,7 +112,11 @@ class OmniboxResult : public ChromeSearchResult {
private:
void UpdateIcon() {
- int resource_id = match_.starred ?
+ BookmarkModel* bookmark_model =
+ BookmarkModelFactory::GetForProfile(profile_);
+ bool is_bookmarked =
+ bookmark_model && bookmark_model->IsBookmarked(match_.destination_url);
+ int resource_id = is_bookmarked ?
IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type);
SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
resource_id));
« no previous file with comments | « chrome/browser/metrics/omnibox_metrics_provider.cc ('k') | chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698