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

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

Issue 7574021: Remove frontend code that allows for dynamic profile setting, and read the profile off the browse... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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_popup_model.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete_popup_model.cc (revision 95527)
+++ chrome/browser/autocomplete/autocomplete_popup_model.cc (working copy)
@@ -25,11 +25,9 @@
AutocompletePopupModel::AutocompletePopupModel(
AutocompletePopupView* popup_view,
- AutocompleteEditModel* edit_model,
- Profile* profile)
+ AutocompleteEditModel* edit_model)
: view_(popup_view),
edit_model_(edit_model),
- profile_(profile),
hovered_line_(kNoMatch),
selected_line_(kNoMatch) {
edit_model->set_popup_model(this);
@@ -136,7 +134,7 @@
if (match.template_url) {
TemplateURLService* url_service =
- TemplateURLServiceFactory::GetForProfile(profile_);
+ TemplateURLServiceFactory::GetForProfile(edit_model_->profile());
if (!url_service)
return false;
@@ -171,8 +169,9 @@
if (keyword_hint.empty())
return false;
+ Profile* profile = edit_model_->profile();
TemplateURLService* url_service =
- TemplateURLServiceFactory::GetForProfile(profile_);
+ TemplateURLServiceFactory::GetForProfile(profile);
if (!url_service)
return false;
url_service->Load();
@@ -185,12 +184,10 @@
// Don't provide a hint for inactive/disabled extension keywords.
if (template_url->IsExtensionKeyword()) {
- const Extension* extension = profile_->GetExtensionService()->
+ const Extension* extension = profile->GetExtensionService()->
GetExtensionById(template_url->GetExtensionId(), false);
- if (!extension ||
- (profile_->IsOffTheRecord() &&
- !profile_->GetExtensionService()->
- IsIncognitoEnabled(extension->id())))
+ if (!extension || (profile->IsOffTheRecord() &&
+ !profile->GetExtensionService()->IsIncognitoEnabled(extension->id())))
return false;
}
@@ -250,7 +247,7 @@
if (!match.template_url || !match.template_url->IsExtensionKeyword())
return NULL;
- return &profile_->GetExtensionService()->GetOmniboxPopupIcon(
+ return &edit_model_->profile()->GetExtensionService()->GetOmniboxPopupIcon(
match.template_url->GetExtensionId());
}
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_popup_model.h ('k') | chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698