Commit 865282dd authored by Sheng-Hao Tsao's avatar Sheng-Hao Tsao Committed by Commit Bot

Add cameraMediaConsolidated to chromeosInfoPrivate API

This CL adds cameraMediaConsolidated as one of the preference key value
pairs that can be set through chromeosInfoPrivate API. The preference is
useful for determining which camera app (Chrome camera app or Google camera
app) to open when users click the camera icon.

cameraMediaConsolidated preference

Bug: 861952
Test: Chrome extension can call chromeosInfoPrivate.set() to set
Change-Id: I8960734d5bb44712a86c7998081c91e750d963cd
Reviewed-on: https://chromium-review.googlesource.com/1130543
Commit-Queue: Sheng-hao Tsao <shenghao@google.com>
Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574984}
parent 4cf0c387
...@@ -109,6 +109,9 @@ const char kPropertySwitchAccessEnabled[] = "a11ySwitchAccessEnabled"; ...@@ -109,6 +109,9 @@ const char kPropertySwitchAccessEnabled[] = "a11ySwitchAccessEnabled";
// Key which corresponds to the send-function-keys property in JS. // Key which corresponds to the send-function-keys property in JS.
const char kPropertySendFunctionsKeys[] = "sendFunctionKeys"; const char kPropertySendFunctionsKeys[] = "sendFunctionKeys";
// Key which corresponds to the camera-media-consolidated property in JS.
const char kPropertyCameraMediaConsolidated[] = "cameraMediaConsolidated";
// Property not found error message. // Property not found error message.
const char kPropertyNotFound[] = "Property '*' does not exist."; const char kPropertyNotFound[] = "Property '*' does not exist.";
...@@ -203,7 +206,8 @@ const struct { ...@@ -203,7 +206,8 @@ const struct {
ash::prefs::kAccessibilitySelectToSpeakEnabled}, ash::prefs::kAccessibilitySelectToSpeakEnabled},
{kPropertySwitchAccessEnabled, {kPropertySwitchAccessEnabled,
ash::prefs::kAccessibilitySwitchAccessEnabled}, ash::prefs::kAccessibilitySwitchAccessEnabled},
{kPropertySendFunctionsKeys, prefs::kLanguageSendFunctionKeys}}; {kPropertySendFunctionsKeys, prefs::kLanguageSendFunctionKeys},
{kPropertyCameraMediaConsolidated, prefs::kCameraMediaConsolidated}};
const char* GetBoolPrefNameForApiProperty(const char* api_name) { const char* GetBoolPrefNameForApiProperty(const char* api_name) {
for (size_t i = 0; for (size_t i = 0;
......
...@@ -62,6 +62,8 @@ IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, TestGetAndSet) { ...@@ -62,6 +62,8 @@ IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, TestGetAndSet) {
ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( ASSERT_FALSE(profile()->GetPrefs()->GetBoolean(
prefs::kLanguageSendFunctionKeys)); prefs::kLanguageSendFunctionKeys));
ASSERT_FALSE(
profile()->GetPrefs()->GetBoolean(prefs::kCameraMediaConsolidated));
ASSERT_TRUE(RunComponentExtensionTest("chromeos_info_private/basic")) ASSERT_TRUE(RunComponentExtensionTest("chromeos_info_private/basic"))
<< message_; << message_;
...@@ -77,6 +79,7 @@ IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, TestGetAndSet) { ...@@ -77,6 +79,7 @@ IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, TestGetAndSet) {
ASSERT_TRUE(prefs->GetBoolean(ash::prefs::kAccessibilityAutoclickEnabled)); ASSERT_TRUE(prefs->GetBoolean(ash::prefs::kAccessibilityAutoclickEnabled));
ASSERT_TRUE(prefs->GetBoolean(prefs::kLanguageSendFunctionKeys)); ASSERT_TRUE(prefs->GetBoolean(prefs::kLanguageSendFunctionKeys));
ASSERT_TRUE(prefs->GetBoolean(prefs::kCameraMediaConsolidated));
} }
// TODO(steel): Investigate merging the following tests. // TODO(steel): Investigate merging the following tests.
......
...@@ -295,6 +295,7 @@ void Preferences::RegisterProfilePrefs( ...@@ -295,6 +295,7 @@ void Preferences::RegisterProfilePrefs(
prefs::kUse24HourClock, prefs::kUse24HourClock,
base::GetHourClockType() == base::k24HourClock, base::GetHourClockType() == base::k24HourClock,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kCameraMediaConsolidated, false);
registry->RegisterBooleanPref( registry->RegisterBooleanPref(
drive::prefs::kDisableDrive, false, drive::prefs::kDisableDrive, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
"a11yFocusHighlightEnabled", "a11yFocusHighlightEnabled",
"a11ySelectToSpeakEnabled", "a11ySelectToSpeakEnabled",
"a11ySwitchAccessEnabled", "a11ySwitchAccessEnabled",
"sendFunctionKeys"], "sendFunctionKeys",
"cameraMediaConsolidated"],
"description": "Chrome OS system property name" "description": "Chrome OS system property name"
}, },
{ {
...@@ -102,6 +103,7 @@ ...@@ -102,6 +103,7 @@
"a11yAutoClickEnabled" : {"type": "boolean", "optional": true, "description": "If true, auto mouse click accessibility feature is turned on."}, "a11yAutoClickEnabled" : {"type": "boolean", "optional": true, "description": "If true, auto mouse click accessibility feature is turned on."},
"a11yVirtualKeyboardEnabled" : {"type": "boolean", "optional": true, "description": "If true, virtual keyboard will be enabled."}, "a11yVirtualKeyboardEnabled" : {"type": "boolean", "optional": true, "description": "If true, virtual keyboard will be enabled."},
"sendFunctionKeys" : {"type": "boolean", "optional": true, "description": "If true, the ChromeOS top row keys send function keys."}, "sendFunctionKeys" : {"type": "boolean", "optional": true, "description": "If true, the ChromeOS top row keys send function keys."},
"cameraMediaConsolidated" : {"type": "boolean", "optional": true, "description": "True if camera photos and videos have been consolidated to one place."},
"supportedTimezones" : { "supportedTimezones" : {
"type": "array", "type": "array",
"items": { "items": {
......
...@@ -1909,6 +1909,9 @@ const char kArcAppInstallEventLoggingEnabled[] = ...@@ -1909,6 +1909,9 @@ const char kArcAppInstallEventLoggingEnabled[] =
// with removing the users while at the login screen. // with removing the users while at the login screen.
const char kRemoveUsersRemoteCommand[] = "remove_users_remote_command"; const char kRemoveUsersRemoteCommand[] = "remove_users_remote_command";
// Whether camera-produced media files have been consolidated to one place.
const char kCameraMediaConsolidated[] = "camera_media_consolidated";
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
// Whether there is a Flash version installed that supports clearing LSO data. // Whether there is a Flash version installed that supports clearing LSO data.
......
...@@ -646,6 +646,7 @@ extern const char kPowerMetricsLidClosedSuspendCount[]; ...@@ -646,6 +646,7 @@ extern const char kPowerMetricsLidClosedSuspendCount[];
extern const char kReportingUsers[]; extern const char kReportingUsers[];
extern const char kArcAppInstallEventLoggingEnabled[]; extern const char kArcAppInstallEventLoggingEnabled[];
extern const char kRemoveUsersRemoteCommand[]; extern const char kRemoveUsersRemoteCommand[];
extern const char kCameraMediaConsolidated[];
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
extern const char kClearPluginLSODataEnabled[]; extern const char kClearPluginLSODataEnabled[];
......
...@@ -88,6 +88,7 @@ function prefsTest() { ...@@ -88,6 +88,7 @@ function prefsTest() {
chrome.chromeosInfoPrivate.set('a11yAutoClickEnabled', true); chrome.chromeosInfoPrivate.set('a11yAutoClickEnabled', true);
chrome.chromeosInfoPrivate.set('a11yVirtualKeyboardEnabled', true); chrome.chromeosInfoPrivate.set('a11yVirtualKeyboardEnabled', true);
chrome.chromeosInfoPrivate.set('sendFunctionKeys', true); chrome.chromeosInfoPrivate.set('sendFunctionKeys', true);
chrome.chromeosInfoPrivate.set('cameraMediaConsolidated', true);
chrome.chromeosInfoPrivate.get( chrome.chromeosInfoPrivate.get(
['a11yLargeCursorEnabled', ['a11yLargeCursorEnabled',
'a11yStickyKeysEnabled', 'a11yStickyKeysEnabled',
...@@ -96,7 +97,8 @@ function prefsTest() { ...@@ -96,7 +97,8 @@ function prefsTest() {
'a11yScreenMagnifierEnabled', 'a11yScreenMagnifierEnabled',
'a11yAutoClickEnabled', 'a11yAutoClickEnabled',
'a11yVirtualKeyboardEnabled', 'a11yVirtualKeyboardEnabled',
'sendFunctionKeys'], 'sendFunctionKeys',
'cameraMediaConsolidated'],
pass( pass(
function(values) { function(values) {
chrome.test.assertEq(values['a11yLargeCursorEnabled'], true); chrome.test.assertEq(values['a11yLargeCursorEnabled'], true);
...@@ -107,6 +109,7 @@ function prefsTest() { ...@@ -107,6 +109,7 @@ function prefsTest() {
chrome.test.assertEq(values['a11yAutoClickEnabled'], true); chrome.test.assertEq(values['a11yAutoClickEnabled'], true);
chrome.test.assertEq(values['a11yVirtualKeyboardEnabled'], true); chrome.test.assertEq(values['a11yVirtualKeyboardEnabled'], true);
chrome.test.assertEq(values['sendFunctionKeys'], true); chrome.test.assertEq(values['sendFunctionKeys'], true);
chrome.test.assertEq(values['cameraMediaConsolidated'], true);
} }
)); ));
} }
...@@ -130,6 +133,7 @@ var tests = generateTestsForKeys(['hwid', ...@@ -130,6 +133,7 @@ var tests = generateTestsForKeys(['hwid',
'a11yAutoClickEnabled', 'a11yAutoClickEnabled',
'a11yVirtualKeyboardEnabled', 'a11yVirtualKeyboardEnabled',
'sendFunctionKeys', 'sendFunctionKeys',
'cameraMediaConsolidated',
'timezone', 'timezone',
'supportedTimezones']) 'supportedTimezones'])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment