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

Unified Diff: chrome/browser/chromeos/extensions/first_run_private_api.cc

Issue 2298493003: [Extensions] Convert some ChromeSyncExtensionFunctions (Closed)
Patch Set: fix Created 4 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/chromeos/extensions/first_run_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/first_run_private_api.cc b/chrome/browser/chromeos/extensions/first_run_private_api.cc
index de98afb7efe6b76b533dab74191d6d4018781a01..2634c576b587cf6c67ee2ee5c842b170187fd720 100644
--- a/chrome/browser/chromeos/extensions/first_run_private_api.cc
+++ b/chrome/browser/chromeos/extensions/first_run_private_api.cc
@@ -19,12 +19,14 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/webui/web_ui_util.h"
-bool FirstRunPrivateGetLocalizedStringsFunction::RunSync() {
+ExtensionFunction::ResponseAction
+FirstRunPrivateGetLocalizedStringsFunction::Run() {
UMA_HISTOGRAM_COUNTS("CrosFirstRun.DialogShown", 1);
std::unique_ptr<base::DictionaryValue> localized_strings(
new base::DictionaryValue());
const user_manager::User* user =
- chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile());
+ chromeos::ProfileHelper::Get()->GetUserByProfile(
+ Profile::FromBrowserContext(browser_context()));
if (!user->GetGivenName().empty()) {
localized_strings->SetString(
"greetingHeader",
@@ -55,11 +57,10 @@ bool FirstRunPrivateGetLocalizedStringsFunction::RunSync() {
const std::string& app_locale = g_browser_process->GetApplicationLocale();
webui::SetLoadTimeDataDefaults(app_locale, localized_strings.get());
- SetResult(std::move(localized_strings));
- return true;
+ return RespondNow(OneArgument(std::move(localized_strings)));
}
-bool FirstRunPrivateLaunchTutorialFunction::RunSync() {
+ExtensionFunction::ResponseAction FirstRunPrivateLaunchTutorialFunction::Run() {
chromeos::first_run::LaunchTutorial();
- return true;
+ return RespondNow(NoArguments());
}
« no previous file with comments | « chrome/browser/chromeos/extensions/first_run_private_api.h ('k') | chrome/browser/extensions/api/browser/browser_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698