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

Unified Diff: chrome/browser/ui/webui/flags_ui.cc

Issue 6880341: Merge 83556 - Change about:flags page to not allow anyone but the owner modify it. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: Created 9 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
« no previous file with comments | « chrome/browser/resources/flags_warning.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/flags_ui.cc
===================================================================
--- chrome/browser/ui/webui/flags_ui.cc (revision 83692)
+++ chrome/browser/ui/webui/flags_ui.cc (working copy)
@@ -26,6 +26,11 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/user_cros_settings_provider.h"
+#include "chrome/browser/chromeos/login/user_manager.h"
+#endif
+
namespace {
///////////////////////////////////////////////////////////////////////////////
@@ -85,10 +90,23 @@
localized_strings.SetString("enable",
l10n_util::GetStringUTF16(IDS_FLAGS_ENABLE));
+ base::StringPiece html =
+ ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_FLAGS_HTML);
+#if defined (OS_CHROMEOS)
+ if (!chromeos::UserManager::Get()->current_user_is_owner()) {
+ html = ResourceBundle::GetSharedInstance().GetRawDataResource(
+ IDR_FLAGS_HTML_WARNING);
+
+ // Set the strings to show which user can actually change the flags
+ localized_strings.SetString("ownerOnly", l10n_util::GetStringUTF16(
+ IDS_OPTIONS_ACCOUNTS_OWNER_ONLY));
+ localized_strings.SetString("ownerUserId", UTF8ToUTF16(
+ chromeos::UserCrosSettingsProvider::cached_owner()));
+ }
+#endif
+ static const base::StringPiece flags_html(html);
ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings);
- static const base::StringPiece flags_html(
- ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_FLAGS_HTML));
std::string full_html(flags_html.data(), flags_html.size());
jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html);
jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html);
« no previous file with comments | « chrome/browser/resources/flags_warning.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698