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

Unified Diff: chrome/browser/ui/omnibox/omnibox_popup_model.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/omnibox/omnibox_popup_model.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_popup_model.cc b/chrome/browser/ui/omnibox/omnibox_popup_model.cc
index b9006a6ac9d022694b622dc1ff7b9ce0c64114a1..cb0f9a4d14987125ebdb3d346669185a50392fe6 100644
--- a/chrome/browser/ui/omnibox/omnibox_popup_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_popup_model.cc
@@ -9,11 +9,13 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
+#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/extensions/api/omnibox/omnibox_api.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/omnibox/omnibox_popup_model_observer.h"
#include "chrome/browser/ui/omnibox/omnibox_popup_view.h"
+#include "components/bookmarks/browser/bookmark_model.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
#include "third_party/icu/source/common/unicode/ubidi.h"
@@ -255,6 +257,12 @@ gfx::Image OmniboxPopupModel::GetIconIfExtensionMatch(
return gfx::Image();
}
+bool OmniboxPopupModel::IsStarredMatch(const AutocompleteMatch& match) const {
+ Profile* profile = edit_model_->profile();
+ BookmarkModel* bookmark_model = BookmarkModelFactory::GetForProfile(profile);
+ return bookmark_model && bookmark_model->IsBookmarked(match.destination_url);
+}
+
void OmniboxPopupModel::OnResultChanged() {
const AutocompleteResult& result = this->result();
selected_line_ = result.default_match() == result.end() ?
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_popup_model.h ('k') | chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698