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

Unified Diff: chrome/browser/autocomplete/autocomplete_controller.cc

Issue 10913262: Implement Bookmark Autocomplete Provider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Address clint complaints. Created 8 years, 2 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/autocomplete/autocomplete_controller.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete_controller.cc (revision 159706)
+++ chrome/browser/autocomplete/autocomplete_controller.cc (working copy)
@@ -15,6 +15,7 @@
#include "base/stringprintf.h"
#include "base/time.h"
#include "chrome/browser/autocomplete/autocomplete_controller_delegate.h"
+#include "chrome/browser/autocomplete/bookmark_provider.h"
#include "chrome/browser/autocomplete/builtin_provider.h"
#include "chrome/browser/autocomplete/extension_app_provider.h"
#include "chrome/browser/autocomplete/history_contents_provider.h"
@@ -27,6 +28,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/chrome_switches.h"
#include "content/public/browser/notification_service.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -52,6 +54,8 @@
case AutocompleteMatch::HISTORY_TITLE: return 61;
case AutocompleteMatch::HISTORY_BODY: return 62;
case AutocompleteMatch::HISTORY_KEYWORD: return 63;
+ case AutocompleteMatch::BOOKMARK_TITLE: return 65;
+ // NOTE: Default is equivalent to OMNIBOX_OTHER and must remain 64.
Peter Kasting 2012/10/04 20:40:31 OMNIBOX_OTHER? What is that?
mrossetti 2012/10/05 22:10:04 Please see email sent separately.
default: return 64;
}
}
@@ -137,6 +141,12 @@
providers_.push_back(zero_suggest_provider_);
}
+ // Disable the BookmarkProvider if there the switch says so.
Peter Kasting 2012/10/04 20:40:31 Nit: Comment adds nothing
mrossetti 2012/10/05 22:10:04 Done. (I was just following the pattern used for Z
+ if ((provider_types & AutocompleteProvider::TYPE_BOOKMARK) &&
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableBookmarkAutocompleteProvider))
+ providers_.push_back(new BookmarkProvider(this, profile));
+
for (ACProviders::iterator i(providers_.begin()); i != providers_.end(); ++i)
(*i)->AddRef();
}

Powered by Google App Engine
This is Rietveld 408576698