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

Side by Side Diff: chrome/browser/chromeos/dom_ui/cros_personal_options_handler.cc

Issue 3532010: Add a pref checkbox to enable/disable screen lock for ChromeOs. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: firx chromeos trybot 2, set expectations Created 10 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/dom_ui/cros_personal_options_handler.h"
6
7 #include "app/l10n_util.h"
8 #include "base/values.h"
9 #include "chrome/browser/chromeos/login/user_manager.h"
10 #include "chrome/browser/dom_ui/dom_ui_util.h"
11 #include "grit/generated_resources.h"
12 #include "third_party/skia/include/core/SkBitmap.h"
13
14 namespace chromeos {
15
16 CrosPersonalOptionsHandler::CrosPersonalOptionsHandler() {
17 }
18
19 CrosPersonalOptionsHandler::~CrosPersonalOptionsHandler() {
20 }
21
22 void CrosPersonalOptionsHandler::GetLocalizedValues(
23 DictionaryValue* localized_strings) {
24 localized_strings->SetString("account",
25 l10n_util::GetStringUTF16(IDS_OPTIONS_PERSONAL_ACCOUNT_GROUP_NAME));
26 localized_strings->SetString("enable_screenlock",
27 l10n_util::GetStringUTF16(IDS_OPTIONS_ENABLE_SCREENLOCKER_CHECKBOX));
28 }
29
30 void CrosPersonalOptionsHandler::RegisterMessages() {
31 dom_ui_->RegisterMessageCallback(
32 "loadAccountPicture",
33 NewCallback(this, &CrosPersonalOptionsHandler::LoadAccountPicture));
34 }
35
36 void CrosPersonalOptionsHandler::LoadAccountPicture(const ListValue* args) {
37 const SkBitmap& account_picture =
38 UserManager::Get()->logged_in_user().image();
39
40 if (!account_picture.isNull()) {
41 StringValue data_url(dom_ui_util::GetImageDataUrl(account_picture));
42 dom_ui_->CallJavascriptFunction(L"PersonalOptions.setAccountPicture",
43 data_url);
44 }
45 }
46
47 } // namespace chromeos
48
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/dom_ui/cros_personal_options_handler.h ('k') | chrome/browser/chromeos/preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698