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

Unified Diff: chrome/browser/extensions/api/omnibox/omnibox_api.cc

Issue 166053003: Move ProfileKeyedAPI implementations to take BrowserContext in the constructor (part 2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: | Created 6 years, 10 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/extensions/api/omnibox/omnibox_api.cc
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
index b5123971e5b909796e126bb962cf7e164c44a074..dc098abc70363ed4f630983b0fa0d8112e71064e 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -175,13 +175,15 @@ void ExtensionOmniboxEventRouter::OnInputCancelled(
DispatchEventToExtension(extension_id, event.Pass());
}
-OmniboxAPI::OmniboxAPI(Profile* profile)
- : profile_(profile),
- url_service_(TemplateURLServiceFactory::GetForProfile(profile)) {
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
- content::Source<Profile>(profile));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
- content::Source<Profile>(profile));
+OmniboxAPI::OmniboxAPI(content::BrowserContext* context)
+ : profile_(Profile::FromBrowserContext(context)),
+ url_service_(TemplateURLServiceFactory::GetForProfile(profile_)) {
+ registrar_.Add(this,
+ chrome::NOTIFICATION_EXTENSION_LOADED,
+ content::Source<Profile>(profile_));
+ registrar_.Add(this,
+ chrome::NOTIFICATION_EXTENSION_UNLOADED,
+ content::Source<Profile>(profile_));
if (url_service_) {
template_url_sub_ = url_service_->RegisterOnLoadedCallback(
base::Bind(&OmniboxAPI::OnTemplateURLsLoaded,
@@ -211,8 +213,8 @@ ProfileKeyedAPIFactory<OmniboxAPI>* OmniboxAPI::GetFactoryInstance() {
}
// static
-OmniboxAPI* OmniboxAPI::Get(Profile* profile) {
- return ProfileKeyedAPIFactory<OmniboxAPI>::GetForProfile(profile);
+OmniboxAPI* OmniboxAPI::Get(content::BrowserContext* context) {
+ return ProfileKeyedAPIFactory<OmniboxAPI>::GetForProfile(context);
}
void OmniboxAPI::Observe(int type,

Powered by Google App Engine
This is Rietveld 408576698