| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/flags_ui.h" | 5 #include "chrome/browser/ui/webui/flags_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "content/public/browser/web_ui_data_source.h" | 26 #include "content/public/browser/web_ui_data_source.h" |
| 27 #include "content/public/browser/web_ui_message_handler.h" | 27 #include "content/public/browser/web_ui_message_handler.h" |
| 28 #include "grit/browser_resources.h" | 28 #include "grit/browser_resources.h" |
| 29 #include "grit/chromium_strings.h" | 29 #include "grit/chromium_strings.h" |
| 30 #include "grit/generated_resources.h" | 30 #include "grit/generated_resources.h" |
| 31 #include "grit/theme_resources.h" | 31 #include "grit/theme_resources.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 | 34 |
| 35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
| 36 #include "base/chromeos/chromeos_version.h" | 36 #include "base/sys_info.h" |
| 37 #include "chrome/browser/chromeos/login/user_manager.h" | 37 #include "chrome/browser/chromeos/login/user_manager.h" |
| 38 #include "chrome/browser/chromeos/settings/cros_settings.h" | 38 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 39 #include "chrome/browser/chromeos/settings/owner_flags_storage.h" | 39 #include "chrome/browser/chromeos/settings/owner_flags_storage.h" |
| 40 #include "chromeos/dbus/dbus_thread_manager.h" | 40 #include "chromeos/dbus/dbus_thread_manager.h" |
| 41 #include "chromeos/dbus/session_manager_client.h" | 41 #include "chromeos/dbus/session_manager_client.h" |
| 42 #include "components/user_prefs/pref_registry_syncable.h" | 42 #include "components/user_prefs/pref_registry_syncable.h" |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 using content::WebContents; | 45 using content::WebContents; |
| 46 using content::WebUIMessageHandler; | 46 using content::WebUIMessageHandler; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 67 IDS_FLAGS_NO_UNSUPPORTED_EXPERIMENTS); | 67 IDS_FLAGS_NO_UNSUPPORTED_EXPERIMENTS); |
| 68 source->AddLocalizedString("flagsNotSupported", IDS_FLAGS_NOT_AVAILABLE); | 68 source->AddLocalizedString("flagsNotSupported", IDS_FLAGS_NOT_AVAILABLE); |
| 69 source->AddLocalizedString("flagsRestartNotice", IDS_FLAGS_RELAUNCH_NOTICE); | 69 source->AddLocalizedString("flagsRestartNotice", IDS_FLAGS_RELAUNCH_NOTICE); |
| 70 source->AddLocalizedString("flagsRestartButton", IDS_FLAGS_RELAUNCH_BUTTON); | 70 source->AddLocalizedString("flagsRestartButton", IDS_FLAGS_RELAUNCH_BUTTON); |
| 71 source->AddLocalizedString("resetAllButton", IDS_FLAGS_RESET_ALL_BUTTON); | 71 source->AddLocalizedString("resetAllButton", IDS_FLAGS_RESET_ALL_BUTTON); |
| 72 source->AddLocalizedString("disable", IDS_FLAGS_DISABLE); | 72 source->AddLocalizedString("disable", IDS_FLAGS_DISABLE); |
| 73 source->AddLocalizedString("enable", IDS_FLAGS_ENABLE); | 73 source->AddLocalizedString("enable", IDS_FLAGS_ENABLE); |
| 74 | 74 |
| 75 #if defined(OS_CHROMEOS) | 75 #if defined(OS_CHROMEOS) |
| 76 if (!chromeos::UserManager::Get()->IsCurrentUserOwner() && | 76 if (!chromeos::UserManager::Get()->IsCurrentUserOwner() && |
| 77 base::chromeos::IsRunningOnChromeOS()) { | 77 base::SysInfo::IsRunningOnChromeOS()) { |
| 78 // Set the strings to show which user can actually change the flags. | 78 // Set the strings to show which user can actually change the flags. |
| 79 std::string owner; | 79 std::string owner; |
| 80 chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner); | 80 chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner); |
| 81 source->AddString("ownerWarning", | 81 source->AddString("ownerWarning", |
| 82 l10n_util::GetStringFUTF16(IDS_SYSTEM_FLAGS_OWNER_ONLY, | 82 l10n_util::GetStringFUTF16(IDS_SYSTEM_FLAGS_OWNER_ONLY, |
| 83 UTF8ToUTF16(owner))); | 83 UTF8ToUTF16(owner))); |
| 84 } else { | 84 } else { |
| 85 // The warning will be only shown on ChromeOS, when the current user is not | 85 // The warning will be only shown on ChromeOS, when the current user is not |
| 86 // the owner. | 86 // the owner. |
| 87 source->AddString("ownerWarning", string16()); | 87 source->AddString("ownerWarning", string16()); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 } | 319 } |
| 320 | 320 |
| 321 #if defined(OS_CHROMEOS) | 321 #if defined(OS_CHROMEOS) |
| 322 // static | 322 // static |
| 323 void FlagsUI::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 323 void FlagsUI::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 324 registry->RegisterListPref(prefs::kEnabledLabsExperiments, | 324 registry->RegisterListPref(prefs::kEnabledLabsExperiments, |
| 325 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 325 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 326 } | 326 } |
| 327 | 327 |
| 328 #endif | 328 #endif |
| OLD | NEW |