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

Side by Side Diff: chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc

Issue 2725463002: MD Settings: Update Bluetooth toggle UI to match spec. (Closed)
Patch Set: . Created 3 years, 9 months 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 unified diff | Download patch
OLDNEW
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/ui/webui/settings/md_settings_localized_strings_provide r.h" 5 #include "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide r.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/number_formatting.h" 10 #include "base/i18n/number_formatting.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 LocalizedString localized_strings[], 62 LocalizedString localized_strings[],
63 size_t num_strings) { 63 size_t num_strings) {
64 for (size_t i = 0; i < num_strings; i++) { 64 for (size_t i = 0; i < num_strings; i++) {
65 html_source->AddLocalizedString(localized_strings[i].name, 65 html_source->AddLocalizedString(localized_strings[i].name,
66 localized_strings[i].id); 66 localized_strings[i].id);
67 } 67 }
68 } 68 }
69 69
70 void AddCommonStrings(content::WebUIDataSource* html_source, Profile* profile) { 70 void AddCommonStrings(content::WebUIDataSource* html_source, Profile* profile) {
71 LocalizedString localized_strings[] = { 71 LocalizedString localized_strings[] = {
72 {"add", IDS_ADD}, 72 {"add", IDS_ADD},
73 {"advancedPageTitle", IDS_SETTINGS_ADVANCED}, 73 {"advancedPageTitle", IDS_SETTINGS_ADVANCED},
74 {"back", IDS_ACCNAME_BACK}, 74 {"back", IDS_ACCNAME_BACK},
75 {"basicPageTitle", IDS_SETTINGS_BASIC}, 75 {"basicPageTitle", IDS_SETTINGS_BASIC},
76 {"cancel", IDS_CANCEL}, 76 {"cancel", IDS_CANCEL},
77 {"close", IDS_CLOSE}, 77 {"close", IDS_CLOSE},
78 {"confirm", IDS_CONFIRM}, 78 {"confirm", IDS_CONFIRM},
79 {"controlledByExtension", IDS_SETTINGS_CONTROLLED_BY_EXTENSION}, 79 {"controlledByExtension", IDS_SETTINGS_CONTROLLED_BY_EXTENSION},
80 {"disable", IDS_DISABLE}, 80 #if defined(OS_CHROMEOS)
81 {"done", IDS_DONE}, 81 {"deviceOff", IDS_SETTINGS_DEVICE_OFF},
82 {"edit", IDS_SETTINGS_EDIT}, 82 {"deviceOn", IDS_SETTINGS_DEVICE_ON},
83 {"learnMore", IDS_LEARN_MORE}, 83 #endif
84 {"menuButtonLabel", IDS_SETTINGS_MENU_BUTTON_LABEL}, 84 {"disable", IDS_DISABLE},
85 {"moreActions", IDS_SETTINGS_MORE_ACTIONS}, 85 {"done", IDS_DONE},
86 {"ok", IDS_OK}, 86 {"edit", IDS_SETTINGS_EDIT},
87 {"restart", IDS_SETTINGS_RESTART}, 87 {"learnMore", IDS_LEARN_MORE},
88 {"save", IDS_SAVE}, 88 {"menuButtonLabel", IDS_SETTINGS_MENU_BUTTON_LABEL},
89 {"settings", IDS_SETTINGS_SETTINGS}, 89 {"moreActions", IDS_SETTINGS_MORE_ACTIONS},
90 {"ok", IDS_OK},
91 {"restart", IDS_SETTINGS_RESTART},
92 {"save", IDS_SAVE},
93 {"settings", IDS_SETTINGS_SETTINGS},
90 }; 94 };
91 AddLocalizedStringsBulk(html_source, localized_strings, 95 AddLocalizedStringsBulk(html_source, localized_strings,
92 arraysize(localized_strings)); 96 arraysize(localized_strings));
93 97
94 html_source->AddBoolean( 98 html_source->AddBoolean(
95 "isGuest", 99 "isGuest",
96 #if defined(OS_CHROMEOS) 100 #if defined(OS_CHROMEOS)
97 user_manager::UserManager::Get()->IsLoggedInAsGuest() || 101 user_manager::UserManager::Get()->IsLoggedInAsGuest() ||
98 user_manager::UserManager::Get()->IsLoggedInAsPublicAccount()); 102 user_manager::UserManager::Get()->IsLoggedInAsPublicAccount());
99 #else 103 #else
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 332
329 #if defined(OS_CHROMEOS) 333 #if defined(OS_CHROMEOS)
330 void AddBluetoothStrings(content::WebUIDataSource* html_source) { 334 void AddBluetoothStrings(content::WebUIDataSource* html_source) {
331 LocalizedString localized_strings[] = { 335 LocalizedString localized_strings[] = {
332 {"bluetoothAccept", IDS_OPTIONS_SETTINGS_BLUETOOTH_ACCEPT_PASSKEY}, 336 {"bluetoothAccept", IDS_OPTIONS_SETTINGS_BLUETOOTH_ACCEPT_PASSKEY},
333 {"bluetoothConnected", IDS_SETTINGS_BLUETOOTH_CONNECTED}, 337 {"bluetoothConnected", IDS_SETTINGS_BLUETOOTH_CONNECTED},
334 {"bluetoothConnecting", IDS_SETTINGS_BLUETOOTH_CONNECTING}, 338 {"bluetoothConnecting", IDS_SETTINGS_BLUETOOTH_CONNECTING},
335 {"bluetoothDeviceListPaired", IDS_SETTINGS_BLUETOOTH_DEVICE_LIST_PAIRED}, 339 {"bluetoothDeviceListPaired", IDS_SETTINGS_BLUETOOTH_DEVICE_LIST_PAIRED},
336 {"bluetoothDeviceListUnpaired", 340 {"bluetoothDeviceListUnpaired",
337 IDS_SETTINGS_BLUETOOTH_DEVICE_LIST_UNPAIRED}, 341 IDS_SETTINGS_BLUETOOTH_DEVICE_LIST_UNPAIRED},
338 {"bluetoothDisabled", IDS_SETTINGS_BLUETOOTH_DISABLED},
fukino 2017/02/28 02:37:09 Could you remove the string id from settings_strin
stevenjb 2017/02/28 03:04:42 Oops, thanks done.
339 {"bluetoothDisconnect", IDS_OPTIONS_SETTINGS_BLUETOOTH_DISCONNECT}, 342 {"bluetoothDisconnect", IDS_OPTIONS_SETTINGS_BLUETOOTH_DISCONNECT},
340 {"bluetoothDismiss", IDS_OPTIONS_SETTINGS_BLUETOOTH_DISMISS_ERROR}, 343 {"bluetoothDismiss", IDS_OPTIONS_SETTINGS_BLUETOOTH_DISMISS_ERROR},
341 {"bluetoothEnabled", IDS_SETTINGS_BLUETOOTH_ENABLED},
fukino 2017/02/28 02:37:09 ditto
stevenjb 2017/02/28 03:04:42 Done.
342 {"bluetoothToggleA11yLabel", 344 {"bluetoothToggleA11yLabel",
343 IDS_SETTINGS_BLUETOOTH_TOGGLE_ACCESSIBILITY_LABEL}, 345 IDS_SETTINGS_BLUETOOTH_TOGGLE_ACCESSIBILITY_LABEL},
344 {"bluetoothExpandA11yLabel", 346 {"bluetoothExpandA11yLabel",
345 IDS_SETTINGS_BLUETOOTH_EXPAND_ACCESSIBILITY_LABEL}, 347 IDS_SETTINGS_BLUETOOTH_EXPAND_ACCESSIBILITY_LABEL},
346 {"bluetoothNoDevices", IDS_SETTINGS_BLUETOOTH_NO_DEVICES}, 348 {"bluetoothNoDevices", IDS_SETTINGS_BLUETOOTH_NO_DEVICES},
347 {"bluetoothNoDevicesFound", IDS_SETTINGS_BLUETOOTH_NO_DEVICES_FOUND}, 349 {"bluetoothNoDevicesFound", IDS_SETTINGS_BLUETOOTH_NO_DEVICES_FOUND},
348 {"bluetoothNotConnected", IDS_SETTINGS_BLUETOOTH_NOT_CONNECTED}, 350 {"bluetoothNotConnected", IDS_SETTINGS_BLUETOOTH_NOT_CONNECTED},
349 {"bluetoothOff", IDS_SETTINGS_BLUETOOTH_OFF},
fukino 2017/02/28 02:37:09 ditto
stevenjb 2017/02/28 03:04:42 Done.
350 {"bluetoothOn", IDS_SETTINGS_BLUETOOTH_ON},
351 {"bluetoothPageTitle", IDS_SETTINGS_BLUETOOTH}, 351 {"bluetoothPageTitle", IDS_SETTINGS_BLUETOOTH},
352 {"bluetoothPair", IDS_SETTINGS_BLUETOOTH_PAIR}, 352 {"bluetoothPair", IDS_SETTINGS_BLUETOOTH_PAIR},
353 {"bluetoothPairDevicePageTitle", 353 {"bluetoothPairDevicePageTitle",
354 IDS_SETTINGS_BLUETOOTH_PAIR_DEVICE_TITLE}, 354 IDS_SETTINGS_BLUETOOTH_PAIR_DEVICE_TITLE},
355 {"bluetoothReject", IDS_OPTIONS_SETTINGS_BLUETOOTH_REJECT_PASSKEY}, 355 {"bluetoothReject", IDS_OPTIONS_SETTINGS_BLUETOOTH_REJECT_PASSKEY},
356 {"bluetoothRemove", IDS_SETTINGS_BLUETOOTH_REMOVE}, 356 {"bluetoothRemove", IDS_SETTINGS_BLUETOOTH_REMOVE},
357 // Device connecting and pairing. 357 // Device connecting and pairing.
358 {"bluetoothStartConnecting", IDS_SETTINGS_BLUETOOTH_START_CONNECTING}, 358 {"bluetoothStartConnecting", IDS_SETTINGS_BLUETOOTH_START_CONNECTING},
359 {"bluetoothEnterKey", IDS_OPTIONS_SETTINGS_BLUETOOTH_ENTER_KEY}, 359 {"bluetoothEnterKey", IDS_OPTIONS_SETTINGS_BLUETOOTH_ENTER_KEY},
360 // These ids are generated in JS using 'bluetooth_' + a value from 360 // These ids are generated in JS using 'bluetooth_' + a value from
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1963 1963
1964 #if defined(OS_CHROMEOS) 1964 #if defined(OS_CHROMEOS)
1965 chromeos::network_element::AddLocalizedStrings(html_source); 1965 chromeos::network_element::AddLocalizedStrings(html_source);
1966 #endif 1966 #endif
1967 policy_indicator::AddLocalizedStrings(html_source); 1967 policy_indicator::AddLocalizedStrings(html_source);
1968 1968
1969 html_source->SetJsonPath(kLocalizedStringsFile); 1969 html_source->SetJsonPath(kLocalizedStringsFile);
1970 } 1970 }
1971 1971
1972 } // namespace settings 1972 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698