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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Profile helper function, rebase 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
« no previous file with comments | « chrome/browser/ui/webui/net_internals_ui.cc ('k') | chrome/browser/ui/webui/ntp/favicon_webui_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index 4f8f26dd4764c4200ea8262ad04e974e1d54bc90..a23063c5eb8000143622016fc25c8b1d5dd5bfe4 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -370,7 +370,7 @@ void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) {
extension_service_->GetAppIds()));
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewTabPage4)) {
- PrefService* prefs = web_ui_->GetProfile()->GetPrefs();
+ PrefService* prefs = Profile::FromWebUI(web_ui_)->GetPrefs();
const ListValue* app_page_names = prefs->GetList(prefs::kNTPAppPageNames);
if (app_page_names && app_page_names->GetSize()) {
dictionary->Set("appPageNames",
@@ -410,7 +410,7 @@ void AppLauncherHandler::HandleGetApps(const ListValue* args) {
// b) Conceptually, it doesn't really make sense to count a
// prefchange-triggered refresh as a promo 'view'.
AppsPromo* apps_promo = extension_service_->apps_promo();
- PrefService* prefs = web_ui_->GetProfile()->GetPrefs();
+ PrefService* prefs = Profile::FromWebUI(web_ui_)->GetPrefs();
bool apps_promo_just_expired = false;
if (apps_promo->ShouldShowPromo(extension_service_->GetAppIds(),
&apps_promo_just_expired)) {
@@ -682,7 +682,7 @@ void AppLauncherHandler::HandleSaveAppPageName(const ListValue* args) {
CHECK(args->GetDouble(1, &page_index));
AutoReset<bool> auto_reset(&ignore_changes_, true);
- PrefService* prefs = web_ui_->GetProfile()->GetPrefs();
+ PrefService* prefs = Profile::FromWebUI(web_ui_)->GetPrefs();
ListPrefUpdate update(prefs, prefs::kNTPAppPageNames);
ListValue* list = update.Get();
list->Set(static_cast<size_t>(page_index), Value::CreateStringValue(name));
@@ -702,7 +702,7 @@ void AppLauncherHandler::HandleGenerateAppForLink(const ListValue* args) {
web_app->title = title;
web_app->app_url = launch_url;
- Profile* profile = web_ui_->GetProfile();
+ Profile* profile = Profile::FromWebUI(web_ui_);
FaviconService* favicon_service =
profile->GetFaviconService(Profile::EXPLICIT_ACCESS);
if (!favicon_service) {
@@ -730,7 +730,7 @@ void AppLauncherHandler::HandleRecordAppLaunchByURL(
static_cast<extension_misc::AppLaunchBucket>(static_cast<int>(source));
CHECK(source < extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
- RecordAppLaunchByURL(web_ui_->GetProfile(), url, bucket);
+ RecordAppLaunchByURL(Profile::FromWebUI(web_ui_), url, bucket);
}
void AppLauncherHandler::OnFaviconForApp(FaviconService::Handle handle,
@@ -897,7 +897,7 @@ void AppLauncherHandler::InstallUIAbort(bool user_initiated) {
ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() {
if (!extension_uninstall_dialog_.get()) {
extension_uninstall_dialog_.reset(
- new ExtensionUninstallDialog(web_ui_->GetProfile()));
+ new ExtensionUninstallDialog(Profile::FromWebUI(web_ui_)));
}
return extension_uninstall_dialog_.get();
}
@@ -905,7 +905,7 @@ ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() {
ExtensionInstallUI* AppLauncherHandler::GetExtensionInstallUI() {
if (!extension_install_ui_.get()) {
extension_install_ui_.reset(
- new ExtensionInstallUI(web_ui_->GetProfile()));
+ new ExtensionInstallUI(Profile::FromWebUI(web_ui_)));
}
return extension_install_ui_.get();
}
« no previous file with comments | « chrome/browser/ui/webui/net_internals_ui.cc ('k') | chrome/browser/ui/webui/ntp/favicon_webui_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698