| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 void ArcSettingsServiceImpl::SyncReportingConsent() const { | 478 void ArcSettingsServiceImpl::SyncReportingConsent() const { |
| 477 bool consent = false; | 479 bool consent = false; |
| 478 CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, &consent); | 480 CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, &consent); |
| 479 base::DictionaryValue extras; | 481 base::DictionaryValue extras; |
| 480 extras.SetBoolean("reportingConsent", consent); | 482 extras.SetBoolean("reportingConsent", consent); |
| 481 SendSettingsBroadcast("org.chromium.arc.intent_helper.SET_REPORTING_CONSENT", | 483 SendSettingsBroadcast("org.chromium.arc.intent_helper.SET_REPORTING_CONSENT", |
| 482 extras); | 484 extras); |
| 483 } | 485 } |
| 484 | 486 |
| 485 void ArcSettingsServiceImpl::SyncSpokenFeedbackEnabled() const { | 487 void ArcSettingsServiceImpl::SyncSpokenFeedbackEnabled() const { |
| 486 SendBoolPrefSettingsBroadcast( | 488 std::string setting = |
| 487 prefs::kAccessibilitySpokenFeedbackEnabled, | 489 "org.chromium.arc.intent_helper.SET_SPOKEN_FEEDBACK_ENABLED"; |
| 488 "org.chromium.arc.intent_helper.SET_SPOKEN_FEEDBACK_ENABLED"); | 490 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 491 chromeos::switches::kEnableChromeVoxArcSupport)) |
| 492 setting = "org.chromium.arc.intent_helper.SET_ACCESSIBILITY_HELPER_ENABLED"; |
| 493 |
| 494 SendBoolPrefSettingsBroadcast(prefs::kAccessibilitySpokenFeedbackEnabled, |
| 495 setting); |
| 489 } | 496 } |
| 490 | 497 |
| 491 void ArcSettingsServiceImpl::SyncTimeZone() const { | 498 void ArcSettingsServiceImpl::SyncTimeZone() const { |
| 492 TimezoneSettings* timezone_settings = TimezoneSettings::GetInstance(); | 499 TimezoneSettings* timezone_settings = TimezoneSettings::GetInstance(); |
| 493 base::string16 timezoneID = timezone_settings->GetCurrentTimezoneID(); | 500 base::string16 timezoneID = timezone_settings->GetCurrentTimezoneID(); |
| 494 base::DictionaryValue extras; | 501 base::DictionaryValue extras; |
| 495 extras.SetString("olsonTimeZone", timezoneID); | 502 extras.SetString("olsonTimeZone", timezoneID); |
| 496 SendSettingsBroadcast("org.chromium.arc.intent_helper.SET_TIME_ZONE", extras); | 503 SendSettingsBroadcast("org.chromium.arc.intent_helper.SET_TIME_ZONE", extras); |
| 497 } | 504 } |
| 498 | 505 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 | 582 |
| 576 void ArcSettingsService::OnInstanceReady() { | 583 void ArcSettingsService::OnInstanceReady() { |
| 577 impl_.reset(new ArcSettingsServiceImpl(arc_bridge_service())); | 584 impl_.reset(new ArcSettingsServiceImpl(arc_bridge_service())); |
| 578 } | 585 } |
| 579 | 586 |
| 580 void ArcSettingsService::OnInstanceClosed() { | 587 void ArcSettingsService::OnInstanceClosed() { |
| 581 impl_.reset(); | 588 impl_.reset(); |
| 582 } | 589 } |
| 583 | 590 |
| 584 } // namespace arc | 591 } // namespace arc |
| OLD | NEW |