Index: chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc |
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 a51aca6da05ffed97e8f9eb7e565661e7f55a34f..eb7b6e2519807e560b5b80db2b4da80fb21cc48a 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); |
} |