| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chromeos/arc/intent_helper/arc_settings_service.h" | 5 #include "chrome/browser/chromeos/arc/intent_helper/arc_settings_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" |
| 9 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 10 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 11 #include "base/values.h" | 12 #include "base/values.h" |
| 12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 14 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 14 #include "chrome/browser/chromeos/settings/cros_settings.h" | 15 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "chromeos/chromeos_switches.h" |
| 17 #include "chromeos/network/network_handler.h" | 19 #include "chromeos/network/network_handler.h" |
| 18 #include "chromeos/network/network_state.h" | 20 #include "chromeos/network/network_state.h" |
| 19 #include "chromeos/network/network_state_handler.h" | 21 #include "chromeos/network/network_state_handler.h" |
| 20 #include "chromeos/network/network_state_handler_observer.h" | 22 #include "chromeos/network/network_state_handler_observer.h" |
| 21 #include "chromeos/network/onc/onc_utils.h" | 23 #include "chromeos/network/onc/onc_utils.h" |
| 22 #include "chromeos/network/proxy/proxy_config_service_impl.h" | 24 #include "chromeos/network/proxy/proxy_config_service_impl.h" |
| 23 #include "chromeos/settings/cros_settings_names.h" | 25 #include "chromeos/settings/cros_settings_names.h" |
| 24 #include "chromeos/settings/timezone_settings.h" | 26 #include "chromeos/settings/timezone_settings.h" |
| 25 #include "components/arc/arc_bridge_service.h" | 27 #include "components/arc/arc_bridge_service.h" |
| 26 #include "components/arc/intent_helper/font_size_util.h" | 28 #include "components/arc/intent_helper/font_size_util.h" |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 SendSettingsBroadcast(action, extras); | 351 SendSettingsBroadcast(action, extras); |
| 350 } | 352 } |
| 351 | 353 |
| 352 void ArcSettingsServiceImpl::SyncFocusHighlightEnabled() const { | 354 void ArcSettingsServiceImpl::SyncFocusHighlightEnabled() const { |
| 353 SendBoolPrefSettingsBroadcast( | 355 SendBoolPrefSettingsBroadcast( |
| 354 prefs::kAccessibilityFocusHighlightEnabled, | 356 prefs::kAccessibilityFocusHighlightEnabled, |
| 355 "org.chromium.arc.intent_helper.SET_FOCUS_HIGHLIGHT_ENABLED"); | 357 "org.chromium.arc.intent_helper.SET_FOCUS_HIGHLIGHT_ENABLED"); |
| 356 } | 358 } |
| 357 | 359 |
| 358 void ArcSettingsServiceImpl::SyncSpokenFeedbackEnabled() const { | 360 void ArcSettingsServiceImpl::SyncSpokenFeedbackEnabled() const { |
| 359 SendBoolPrefSettingsBroadcast( | 361 std::string setting = |
| 360 prefs::kAccessibilitySpokenFeedbackEnabled, | 362 "org.chromium.arc.intent_helper.SET_SPOKEN_FEEDBACK_ENABLED"; |
| 361 "org.chromium.arc.intent_helper.SET_SPOKEN_FEEDBACK_ENABLED"); | 363 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 364 chromeos::switches::kEnableChromeVoxArcSupport)) |
| 365 setting = "org.chromium.arc.intent_helper.SET_ACCESSIBILITY_HELPER_ENABLED"; |
| 366 |
| 367 SendBoolPrefSettingsBroadcast(prefs::kAccessibilitySpokenFeedbackEnabled, |
| 368 setting); |
| 362 } | 369 } |
| 363 | 370 |
| 364 void ArcSettingsServiceImpl::SyncLocale() const { | 371 void ArcSettingsServiceImpl::SyncLocale() const { |
| 365 const PrefService::Preference* pref = | 372 const PrefService::Preference* pref = |
| 366 registrar_.prefs()->FindPreference(prefs::kApplicationLocale); | 373 registrar_.prefs()->FindPreference(prefs::kApplicationLocale); |
| 367 DCHECK(pref); | 374 DCHECK(pref); |
| 368 std::string locale; | 375 std::string locale; |
| 369 bool value_exists = pref->GetValue()->GetAsString(&locale); | 376 bool value_exists = pref->GetValue()->GetAsString(&locale); |
| 370 DCHECK(value_exists); | 377 DCHECK(value_exists); |
| 371 base::DictionaryValue extras; | 378 base::DictionaryValue extras; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 | 522 |
| 516 void ArcSettingsService::OnInstanceReady() { | 523 void ArcSettingsService::OnInstanceReady() { |
| 517 impl_.reset(new ArcSettingsServiceImpl(arc_bridge_service())); | 524 impl_.reset(new ArcSettingsServiceImpl(arc_bridge_service())); |
| 518 } | 525 } |
| 519 | 526 |
| 520 void ArcSettingsService::OnInstanceClosed() { | 527 void ArcSettingsService::OnInstanceClosed() { |
| 521 impl_.reset(); | 528 impl_.reset(); |
| 522 } | 529 } |
| 523 | 530 |
| 524 } // namespace arc | 531 } // namespace arc |
| OLD | NEW |