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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 years, 1 month 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/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index eafa54678b15cf45f329e3b6160ec54e2d3533ee..052e3820bb8e272ee9fb77ffdf30afebfd0fc29f 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -1165,8 +1165,7 @@ void BrowserOptionsHandler::InitializePage() {
if (arc::ArcSessionManager::IsAllowedForProfile(profile) &&
!arc::ArcSessionManager::IsOptInVerificationDisabled()) {
- base::FundamentalValue is_arc_enabled(
- arc::ArcSessionManager::Get()->IsArcEnabled());
+ base::Value is_arc_enabled(arc::ArcSessionManager::Get()->IsArcEnabled());
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.showAndroidAppsSection",
is_arc_enabled);
@@ -1263,10 +1262,10 @@ void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) {
l10n_util::GetStringFUTF16(status_string_id,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
- base::FundamentalValue is_default(
+ base::Value is_default(
status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT);
- base::FundamentalValue can_be_default(
+ base::Value can_be_default(
!IsDisabledByPolicy(default_browser_policy_) &&
(status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT ||
status_string_id == IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT));
@@ -1303,8 +1302,8 @@ void BrowserOptionsHandler::OnTemplateURLServiceChanged() {
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.updateSearchEngines", search_engines,
- base::FundamentalValue(default_index),
- base::FundamentalValue(
+ base::Value(default_index),
+ base::Value(
template_url_service_->is_default_search_managed() ||
template_url_service_->IsExtensionControlledDefaultSearch()));
@@ -1477,7 +1476,7 @@ void BrowserOptionsHandler::ObserveThemeChanged() {
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
bool profile_is_supervised = profile->IsSupervised();
is_system_theme = theme_service->UsingSystemTheme();
- base::FundamentalValue native_theme_enabled(!is_system_theme &&
+ base::Value native_theme_enabled(!is_system_theme &&
!profile_is_supervised);
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setNativeThemeButtonEnabled", native_theme_enabled);
@@ -1485,7 +1484,7 @@ void BrowserOptionsHandler::ObserveThemeChanged() {
bool is_classic_theme = !is_system_theme &&
theme_service->UsingDefaultTheme();
- base::FundamentalValue enabled(!is_classic_theme);
+ base::Value enabled(!is_classic_theme);
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setThemesResetButtonEnabled", enabled);
}
@@ -1524,18 +1523,18 @@ void BrowserOptionsHandler::UpdateAccountPicture() {
void BrowserOptionsHandler::OnAccountPictureManagedChanged(bool managed) {
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setAccountPictureManaged",
- base::FundamentalValue(managed));
+ base::Value(managed));
}
void BrowserOptionsHandler::OnWallpaperManagedChanged(bool managed) {
web_ui()->CallJavascriptFunctionUnsafe("BrowserOptions.setWallpaperManaged",
- base::FundamentalValue(managed));
+ base::Value(managed));
}
void BrowserOptionsHandler::OnSystemTimezonePolicyChanged() {
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setSystemTimezoneManaged",
- base::FundamentalValue(chromeos::system::HasSystemTimezonePolicy()));
+ base::Value(chromeos::system::HasSystemTimezonePolicy()));
}
void BrowserOptionsHandler::OnSystemTimezoneAutomaticDetectionPolicyChanged() {
@@ -1551,7 +1550,7 @@ void BrowserOptionsHandler::OnSystemTimezoneAutomaticDetectionPolicyChanged() {
prefs->GetInteger(prefs::kSystemTimezoneAutomaticDetectionPolicy);
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setSystemTimezoneAutomaticDetectionManaged",
- base::FundamentalValue(is_managed), base::FundamentalValue(value));
+ base::Value(is_managed), base::Value(value));
}
#endif
@@ -1643,13 +1642,13 @@ void BrowserOptionsHandler::FileSelected(const base::FilePath& path, int index,
#if defined(OS_CHROMEOS)
void BrowserOptionsHandler::TouchpadExists(bool exists) {
- base::FundamentalValue val(exists);
+ base::Value val(exists);
web_ui()->CallJavascriptFunctionUnsafe("BrowserOptions.showTouchpadControls",
val);
}
void BrowserOptionsHandler::MouseExists(bool exists) {
- base::FundamentalValue val(exists);
+ base::Value val(exists);
web_ui()->CallJavascriptFunctionUnsafe("BrowserOptions.showMouseControls",
val);
}
@@ -1690,7 +1689,7 @@ void BrowserOptionsHandler::UpdateSyncState() {
// displayed. Hide all hotwording and re-display properly.
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setAllHotwordSectionsVisible",
- base::FundamentalValue(false));
+ base::Value(false));
HandleRequestHotwordAvailable(nullptr);
}
@@ -1783,7 +1782,7 @@ void BrowserOptionsHandler::SetHotwordAudioHistorySectionVisible(
bool visible = logging_enabled && success;
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setAudioHistorySectionVisible",
- base::FundamentalValue(visible), base::StringValue(audio_history_state));
+ base::Value(visible), base::StringValue(audio_history_state));
}
void BrowserOptionsHandler::HandleRequestGoogleNowAvailable(
@@ -1803,7 +1802,7 @@ void BrowserOptionsHandler::HandleRequestGoogleNowAvailable(
bool should_show = is_search_provider_google && has_field_trial;
web_ui()->CallJavascriptFunctionUnsafe("BrowserOptions.setNowSectionVisible",
- base::FundamentalValue(should_show));
+ base::Value(should_show));
}
void BrowserOptionsHandler::HandleRequestHotwordAvailable(
@@ -1836,7 +1835,7 @@ void BrowserOptionsHandler::HandleRequestHotwordAvailable(
if (!is_search_provider_google) {
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setAllHotwordSectionsVisible",
- base::FundamentalValue(false));
+ base::Value(false));
return;
}
@@ -1859,7 +1858,7 @@ void BrowserOptionsHandler::HandleRequestHotwordAvailable(
prefs::kHotwordAlwaysOnSearchEnabled)) {
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setHotwordRetrainLinkVisible",
- base::FundamentalValue(true));
+ base::Value(true));
}
} else {
function_name = "BrowserOptions.showHotwordNoDspSection";
@@ -1994,7 +1993,7 @@ void BrowserOptionsHandler::OnAppReadyChanged(
}
void BrowserOptionsHandler::UpdateAndroidSettingsAppState(bool visible) {
- base::FundamentalValue is_visible(visible);
+ base::Value is_visible(visible);
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setAndroidAppsSettingsVisibility", is_visible);
}
@@ -2025,7 +2024,7 @@ void BrowserOptionsHandler::ShowAccessibilityTalkBackSettings(
void BrowserOptionsHandler::SetupAccessibilityFeatures() {
PrefService* pref_service = g_browser_process->local_state();
- base::FundamentalValue virtual_keyboard_enabled(
+ base::Value virtual_keyboard_enabled(
pref_service->GetBoolean(prefs::kAccessibilityVirtualKeyboardEnabled));
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setVirtualKeyboardCheckboxState",
@@ -2037,7 +2036,7 @@ void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() {
#if defined(GOOGLE_CHROME_BUILD)
// Don't show the reporting setting if we are in the guest mode.
if (Profile::FromWebUI(web_ui())->IsGuestSession()) {
- base::FundamentalValue visible(false);
+ base::Value visible(false);
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setMetricsReportingSettingVisibility", visible);
}
@@ -2132,7 +2131,7 @@ void BrowserOptionsHandler::SetupAutoOpenFileTypes() {
web_ui()->GetWebContents()->GetBrowserContext());
bool display = manager &&
DownloadPrefs::FromDownloadManager(manager)->IsAutoOpenUsed();
- base::FundamentalValue value(display);
+ base::Value value(display);
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setAutoOpenFileTypesDisplayed", value);
}
@@ -2145,9 +2144,9 @@ void BrowserOptionsHandler::SetupProxySettingsSection() {
bool is_extension_controlled = (proxy_config &&
proxy_config->IsExtensionControlled());
- base::FundamentalValue disabled(proxy_config &&
+ base::Value disabled(proxy_config &&
!proxy_config->IsUserModifiable());
- base::FundamentalValue extension_controlled(is_extension_controlled);
+ base::Value extension_controlled(is_extension_controlled);
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setupProxySettingsButton", disabled,
extension_controlled);
@@ -2162,13 +2161,13 @@ void BrowserOptionsHandler::SetupProxySettingsSection() {
void BrowserOptionsHandler::SetupManagingSupervisedUsers() {
bool has_users = !Profile::FromWebUI(web_ui())->
GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty();
- base::FundamentalValue has_users_value(has_users);
+ base::Value has_users_value(has_users);
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.updateManagesSupervisedUsers", has_users_value);
}
void BrowserOptionsHandler::SetupEasyUnlock() {
- base::FundamentalValue is_enabled(
+ base::Value is_enabled(
EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->IsEnabled());
web_ui()->CallJavascriptFunctionUnsafe("BrowserOptions.updateEasyUnlock",
is_enabled);
@@ -2259,12 +2258,12 @@ void BrowserOptionsHandler::SetMetricsReportingCheckbox(bool checked,
bool owner_managed) {
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setMetricsReportingCheckboxState",
- base::FundamentalValue(checked), base::FundamentalValue(policy_managed),
- base::FundamentalValue(owner_managed));
+ base::Value(checked), base::Value(policy_managed),
+ base::Value(owner_managed));
}
void BrowserOptionsHandler::SetupSafeBrowsingExtendedReporting() {
- base::FundamentalValue is_enabled(safe_browsing::IsExtendedReportingEnabled(
+ base::Value is_enabled(safe_browsing::IsExtendedReportingEnabled(
*Profile::FromWebUI(web_ui())->GetPrefs()));
web_ui()->CallJavascriptFunctionUnsafe(
"BrowserOptions.setExtendedReportingEnabledCheckboxState", is_enabled);

Powered by Google App Engine
This is Rietveld 408576698