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

Unified Diff: chrome/browser/ui/webui/chromeos/ui_account_tweaks.cc

Issue 10006028: Plugins page in BWSI session has unnecessary and misleading UI components (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/ui/webui/chromeos/ui_account_tweaks.cc
diff --git a/chrome/browser/ui/webui/chromeos/ui_account_tweaks.cc b/chrome/browser/ui/webui/chromeos/ui_account_tweaks.cc
new file mode 100644
index 0000000000000000000000000000000000000000..34549e7f7ab03a3fab9f0e7cb512ad2291bfe723
--- /dev/null
+++ b/chrome/browser/ui/webui/chromeos/ui_account_tweaks.cc
@@ -0,0 +1,62 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h"
+
+#include "base/bind.h"
Nikita (slow) 2012/04/06 12:36:09 Please cleanup headers. You don't need bind relate
Denis Kuznetsov (DE-MUC) 2012/04/09 11:21:30 Done.
+#include "base/bind_helpers.h"
+#include "base/json/json_reader.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/utf_string_conversions.h"
+#include "base/values.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/cros_settings.h"
+#include "chrome/browser/chromeos/cros_settings_names.h"
+#include "chrome/browser/chromeos/login/authenticator.h"
+#include "chrome/browser/chromeos/login/user_manager.h"
+#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/policy/browser_policy_connector.h"
+#include "content/public/browser/web_ui.h"
+#include "grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+
+namespace chromeos {
+
+/**
+ * Fills given dictionary with account status data (whether current user is
Nikita (slow) 2012/04/06 12:36:09 This comment should be moved to header.
Denis Kuznetsov (DE-MUC) 2012/04/09 11:21:30 Done.
+ * owner/guest, id of the owner).
+ */
+void AddAccountUITweaksLocalizedValues(
+ base::DictionaryValue* localized_strings) {
+ DCHECK(localized_strings);
+
+ std::string owner_email;
+ CrosSettings::Get()->GetString(kDeviceOwner, &owner_email);
+ // Translate owner's email to the display email.
+ std::string display_email =
+ UserManager::Get()->GetUserDisplayEmail(owner_email);
+ localized_strings->SetString("ownerUserId", UTF8ToUTF16(display_email));
+
+ localized_strings->SetString("currentUserIsOwner",
+ UserManager::Get()->IsCurrentUserOwner() ?
+ ASCIIToUTF16("true") : ASCIIToUTF16("false"));
+
+ localized_strings->SetString("loggedInAsGuest",
+ chromeos::UserManager::Get()->IsLoggedInAsGuest() ?
+ ASCIIToUTF16("true") : ASCIIToUTF16("false"));
+}
+
+/**
+ * Fills given data source with account status data (whether current user is
Nikita (slow) 2012/04/06 12:36:09 Remove / move to header.
Denis Kuznetsov (DE-MUC) 2012/04/09 11:21:30 Done.
+ * owner/guest, id of the owner).
+ */
+void AddAccountUITweaksLocalizedValues(
+ ChromeWebUIDataSource* source) {
+ DCHECK(source);
+ DictionaryValue dict;
+ AddAccountUITweaksLocalizedValues(&dict);
+ source->AddLocalizedStrings(dict);
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698