summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc')
-rw-r--r--chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc b/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
index a51aca6..eb7b6e2 100644
--- a/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
+++ b/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
@@ -7,6 +7,7 @@
#include <vector>
#include "base/lazy_instance.h"
+#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/screenlock_private.h"
@@ -100,7 +101,7 @@ bool ScreenlockPrivateShowMessageFunction::RunAsync() {
ScreenlockBridge::LockHandler* locker =
ScreenlockBridge::Get()->lock_handler();
if (locker)
- locker->ShowBannerMessage(params->message);
+ locker->ShowBannerMessage(base::UTF8ToUTF16(params->message));
SendResponse(error_.empty());
return true;
}
@@ -168,9 +169,17 @@ void ScreenlockPrivateShowCustomIconFunction::OnImageLoaded(
const gfx::Image& image) {
ScreenlockBridge::LockHandler* locker =
ScreenlockBridge::Get()->lock_handler();
+ if (!locker) {
+ SetError(kNotLockedError);
+ SendResponse(false);
+ return;
+ }
+
+ ScreenlockBridge::UserPodCustomIconOptions icon;
+ icon.SetIconAsImage(image);
locker->ShowUserPodCustomIcon(
ScreenlockBridge::GetAuthenticatedUserEmail(GetProfile()),
- image);
+ icon);
SendResponse(error_.empty());
}
@@ -212,7 +221,7 @@ bool ScreenlockPrivateSetAuthTypeFunction::RunAsync() {
locker->SetAuthType(
ScreenlockBridge::GetAuthenticatedUserEmail(GetProfile()),
ToLockHandlerAuthType(params->auth_type),
- initial_value);
+ base::UTF8ToUTF16(initial_value));
} else {
SetError(kNotLockedError);
}