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

Unified Diff: chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc

Issue 446743003: Hook up new API for easy unlock to update lock screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698