diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-21 20:56:31 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-21 20:56:31 +0000 |
commit | cc63dea9d84632f8292a4af8eb9ab262d1e71800 (patch) | |
tree | 7227e175544d76e3bc57c8d833cdb2f7355bf3c1 /chrome/browser/autocomplete/autocomplete.cc | |
parent | 9451fde471832f8da5026dcf47a341bb5c88d53e (diff) | |
download | chromium_src-cc63dea9d84632f8292a4af8eb9ab262d1e71800.zip chromium_src-cc63dea9d84632f8292a4af8eb9ab262d1e71800.tar.gz chromium_src-cc63dea9d84632f8292a4af8eb9ab262d1e71800.tar.bz2 |
Fixes up the autocomplete providers to correctly update starred
state. I broke this in order to land my last mongo
patch. HistoryContentsProvider is still lacking in one area.
BUG=1256202
TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete.cc')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc index 4153032..881ac2c 100644 --- a/chrome/browser/autocomplete/autocomplete.cc +++ b/chrome/browser/autocomplete/autocomplete.cc @@ -37,7 +37,9 @@ #include "chrome/browser/autocomplete/keyword_provider.h" #include "chrome/browser/autocomplete/search_provider.h" #include "chrome/browser/external_protocol_handler.h" +#include "chrome/browser/bookmark_bar_model.h" #include "chrome/browser/history_tab_ui.h" +#include "chrome/browser/profile.h" #include "chrome/browser/url_fixer_upper.h" #include "chrome/common/gfx/url_elider.h" #include "chrome/common/l10n_util.h" @@ -411,6 +413,20 @@ std::wstring AutocompleteProvider::StringForURLDisplay( std::wstring()); } +void AutocompleteProvider::UpdateStarredStateOfMatches() { + if (matches_.empty()) + return; + + if (!profile_) + return; + BookmarkBarModel* bookmark_bar_model = profile_->GetBookmarkBarModel(); + if (!bookmark_bar_model || !bookmark_bar_model->IsLoaded()) + return; + + for (ACMatches::iterator i = matches_.begin(); i != matches_.end(); ++i) + i->starred = bookmark_bar_model->IsBookmarked(GURL(i->destination_url)); +} + // AutocompleteResult --------------------------------------------------------- // static |