OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/api/easy_unlock_private/easy_unlock_private_
api.h" | 5 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_
api.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 bool EasyUnlockPrivateGetStringsFunction::RunSync() { | 56 bool EasyUnlockPrivateGetStringsFunction::RunSync() { |
57 scoped_ptr<base::DictionaryValue> strings(new base::DictionaryValue); | 57 scoped_ptr<base::DictionaryValue> strings(new base::DictionaryValue); |
58 | 58 |
59 #if defined(OS_CHROMEOS) | 59 #if defined(OS_CHROMEOS) |
60 const base::string16 device_type = chromeos::GetChromeDeviceType(); | 60 const base::string16 device_type = chromeos::GetChromeDeviceType(); |
61 #else | 61 #else |
62 // TODO(isherman): Set an appropriate device name for non-ChromeOS devices. | 62 // TODO(isherman): Set an appropriate device name for non-ChromeOS devices. |
63 const base::string16 device_type = base::ASCIIToUTF16("Chromeschnozzle"); | 63 const base::string16 device_type = base::ASCIIToUTF16("Chromeschnozzle"); |
64 #endif // defined(OS_CHROMEOS) | 64 #endif // defined(OS_CHROMEOS) |
65 | 65 |
| 66 // Common strings. |
| 67 strings->SetString( |
| 68 "learnMoreLinkTitle", |
| 69 l10n_util::GetStringUTF16(IDS_EASY_UNLOCK_LEARN_MORE_LINK_TITLE)); |
| 70 |
66 // Setup notification strings. | 71 // Setup notification strings. |
67 strings->SetString( | 72 strings->SetString( |
68 "setupNotificationTitle", | 73 "setupNotificationTitle", |
69 l10n_util::GetStringFUTF16(IDS_EASY_UNLOCK_SETUP_NOTIFICATION_TITLE, | 74 l10n_util::GetStringFUTF16(IDS_EASY_UNLOCK_SETUP_NOTIFICATION_TITLE, |
70 device_type)); | 75 device_type)); |
71 strings->SetString( | 76 strings->SetString( |
72 "setupNotificationMessage", | 77 "setupNotificationMessage", |
73 l10n_util::GetStringFUTF16(IDS_EASY_UNLOCK_SETUP_NOTIFICATION_MESSAGE, | 78 l10n_util::GetStringFUTF16(IDS_EASY_UNLOCK_SETUP_NOTIFICATION_MESSAGE, |
74 device_type)); | 79 device_type)); |
75 strings->SetString( | 80 strings->SetString( |
76 "setupNotificationButtonTitle", | 81 "setupNotificationButtonTitle", |
77 l10n_util::GetStringUTF16( | 82 l10n_util::GetStringUTF16( |
78 IDS_EASY_UNLOCK_SETUP_NOTIFICATION_BUTTON_TITLE)); | 83 IDS_EASY_UNLOCK_SETUP_NOTIFICATION_BUTTON_TITLE)); |
79 | 84 |
80 // Success notification strings. | 85 // Success notification strings. |
81 strings->SetString( | 86 strings->SetString( |
82 "successNotificationTitle", | 87 "successNotificationTitle", |
83 l10n_util::GetStringUTF16(IDS_EASY_UNLOCK_SUCCESS_NOTIFICATION_TITLE)); | 88 l10n_util::GetStringUTF16(IDS_EASY_UNLOCK_SUCCESS_NOTIFICATION_TITLE)); |
84 strings->SetString( | 89 strings->SetString( |
85 "successNotificationMessage", | 90 "successNotificationMessage", |
86 l10n_util::GetStringFUTF16(IDS_EASY_UNLOCK_SUCCESS_NOTIFICATION_MESSAGE, | 91 l10n_util::GetStringFUTF16(IDS_EASY_UNLOCK_SUCCESS_NOTIFICATION_MESSAGE, |
87 device_type)); | 92 device_type)); |
88 | 93 |
| 94 // Chromebook added to Easy Unlock notification strings. |
| 95 strings->SetString( |
| 96 "chromebookAddedNotificationTitle", |
| 97 l10n_util::GetStringUTF16( |
| 98 IDS_EASY_UNLOCK_CHROMEBOOK_ADDED_NOTIFICATION_TITLE)); |
| 99 strings->SetString( |
| 100 "chromebookAddedNotificationMessage", |
| 101 l10n_util::GetStringFUTF16( |
| 102 IDS_EASY_UNLOCK_CHROMEBOOK_ADDED_NOTIFICATION_MESSAGE, |
| 103 device_type)); |
| 104 |
89 // Setup dialog strings. | 105 // Setup dialog strings. |
90 // Step 1: Intro. | 106 // Step 1: Intro. |
91 strings->SetString( | 107 strings->SetString( |
92 "setupIntroHeaderTitle", | 108 "setupIntroHeaderTitle", |
93 l10n_util::GetStringFUTF16( | 109 l10n_util::GetStringFUTF16( |
94 IDS_EASY_UNLOCK_SETUP_INTRO_HEADER_TITLE, device_type)); | 110 IDS_EASY_UNLOCK_SETUP_INTRO_HEADER_TITLE, device_type)); |
95 strings->SetString( | 111 strings->SetString( |
96 "setupIntroHeaderText", | 112 "setupIntroHeaderText", |
97 l10n_util::GetStringFUTF16( | 113 l10n_util::GetStringFUTF16( |
98 IDS_EASY_UNLOCK_SETUP_INTRO_HEADER_TEXT, device_type)); | 114 IDS_EASY_UNLOCK_SETUP_INTRO_HEADER_TEXT, device_type)); |
99 strings->SetString( | 115 strings->SetString( |
100 "setupIntroHeaderFootnote", | 116 "setupIntroHeaderFootnote", |
101 l10n_util::GetStringUTF16( | 117 l10n_util::GetStringUTF16( |
102 IDS_EASY_UNLOCK_SETUP_INTRO_HEADER_FOOTNOTE)); | 118 IDS_EASY_UNLOCK_SETUP_INTRO_HEADER_FOOTNOTE)); |
103 strings->SetString( | 119 strings->SetString( |
104 "setupIntroFindPhoneButtonLabel", | 120 "setupIntroFindPhoneButtonLabel", |
105 l10n_util::GetStringUTF16( | 121 l10n_util::GetStringUTF16( |
106 IDS_EASY_UNLOCK_SETUP_INTRO_FIND_PHONE_BUTTON_LABEL)); | 122 IDS_EASY_UNLOCK_SETUP_INTRO_FIND_PHONE_BUTTON_LABEL)); |
107 strings->SetString( | 123 strings->SetString( |
108 "setupIntroFindingPhoneButtonLabel", | 124 "setupIntroFindingPhoneButtonLabel", |
109 l10n_util::GetStringUTF16( | 125 l10n_util::GetStringUTF16( |
110 IDS_EASY_UNLOCK_SETUP_INTRO_FINDING_PHONE_BUTTON_LABEL)); | 126 IDS_EASY_UNLOCK_SETUP_INTRO_FINDING_PHONE_BUTTON_LABEL)); |
111 strings->SetString( | 127 strings->SetString( |
| 128 "setupIntroRetryFindPhoneButtonLabel", |
| 129 l10n_util::GetStringUTF16( |
| 130 IDS_EASY_UNLOCK_SETUP_INTRO_RETRY_FIND_PHONE_BUTTON_LABEL)); |
| 131 strings->SetString( |
112 "setupIntroHowIsThisSecureLinkText", | 132 "setupIntroHowIsThisSecureLinkText", |
113 l10n_util::GetStringUTF16( | 133 l10n_util::GetStringUTF16( |
114 IDS_EASY_UNLOCK_SETUP_INTRO_HOW_IS_THIS_SECURE_LINK_TEXT)); | 134 IDS_EASY_UNLOCK_SETUP_INTRO_HOW_IS_THIS_SECURE_LINK_TEXT)); |
115 // Step 2: Found a viable phone. | 135 // Step 2: Found a viable phone. |
116 strings->SetString( | 136 strings->SetString( |
117 "setupFoundPhoneHeaderTitle", | 137 "setupFoundPhoneHeaderTitle", |
118 l10n_util::GetStringFUTF16( | 138 l10n_util::GetStringFUTF16( |
119 IDS_EASY_UNLOCK_SETUP_FOUND_PHONE_HEADER_TITLE, device_type)); | 139 IDS_EASY_UNLOCK_SETUP_FOUND_PHONE_HEADER_TITLE, device_type)); |
120 strings->SetString( | 140 strings->SetString( |
121 "setupFoundPhoneHeaderText", | 141 "setupFoundPhoneHeaderText", |
122 l10n_util::GetStringFUTF16( | 142 l10n_util::GetStringFUTF16( |
123 IDS_EASY_UNLOCK_SETUP_FOUND_PHONE_HEADER_TEXT, device_type)); | 143 IDS_EASY_UNLOCK_SETUP_FOUND_PHONE_HEADER_TEXT, device_type)); |
124 strings->SetString( | 144 strings->SetString( |
125 "setupFoundPhoneUseThisPhoneButtonLabel", | 145 "setupFoundPhoneUseThisPhoneButtonLabel", |
126 l10n_util::GetStringUTF16( | 146 l10n_util::GetStringUTF16( |
127 IDS_EASY_UNLOCK_SETUP_FOUND_PHONE_USE_THIS_PHONE_BUTTON_LABEL)); | 147 IDS_EASY_UNLOCK_SETUP_FOUND_PHONE_USE_THIS_PHONE_BUTTON_LABEL)); |
| 148 strings->SetString( |
| 149 "setupPairingPhoneFailedButtonLabel", |
| 150 l10n_util::GetStringUTF16( |
| 151 IDS_EASY_UNLOCK_SETUP_PAIRING_PHONE_FAILED_BUTTON_LABEL)); |
128 // Step 3: Setup completed successfully. | 152 // Step 3: Setup completed successfully. |
129 strings->SetString( | 153 strings->SetString( |
130 "setupCompleteHeaderTitle", | 154 "setupCompleteHeaderTitle", |
131 l10n_util::GetStringUTF16( | 155 l10n_util::GetStringUTF16( |
132 IDS_EASY_UNLOCK_SETUP_COMPLETE_HEADER_TITLE)); | 156 IDS_EASY_UNLOCK_SETUP_COMPLETE_HEADER_TITLE)); |
133 strings->SetString( | 157 strings->SetString( |
134 "setupCompleteHeaderText", | 158 "setupCompleteHeaderText", |
135 l10n_util::GetStringUTF16( | 159 l10n_util::GetStringUTF16( |
136 IDS_EASY_UNLOCK_SETUP_COMPLETE_HEADER_TEXT)); | 160 IDS_EASY_UNLOCK_SETUP_COMPLETE_HEADER_TEXT)); |
137 strings->SetString( | 161 strings->SetString( |
(...skipping 16 matching lines...) Expand all Loading... |
154 IDS_EASY_UNLOCK_SETUP_ERROR_OFFLINE, device_type)); | 178 IDS_EASY_UNLOCK_SETUP_ERROR_OFFLINE, device_type)); |
155 strings->SetString( | 179 strings->SetString( |
156 "setupErrorFindingPhone", | 180 "setupErrorFindingPhone", |
157 l10n_util::GetStringUTF16(IDS_EASY_UNLOCK_SETUP_ERROR_FINDING_PHONE)); | 181 l10n_util::GetStringUTF16(IDS_EASY_UNLOCK_SETUP_ERROR_FINDING_PHONE)); |
158 strings->SetString( | 182 strings->SetString( |
159 "setupErrorBluetoothConnectionFailed", | 183 "setupErrorBluetoothConnectionFailed", |
160 l10n_util::GetStringFUTF16( | 184 l10n_util::GetStringFUTF16( |
161 IDS_EASY_UNLOCK_SETUP_ERROR_BLUETOOTH_CONNECTION_FAILED, | 185 IDS_EASY_UNLOCK_SETUP_ERROR_BLUETOOTH_CONNECTION_FAILED, |
162 device_type)); | 186 device_type)); |
163 strings->SetString( | 187 strings->SetString( |
| 188 "setupErrorConnectionToPhoneTimeout", |
| 189 l10n_util::GetStringFUTF16( |
| 190 IDS_EASY_UNLOCK_SETUP_ERROR_CONNECT_TO_PHONE_TIMEOUT, |
| 191 device_type)); |
| 192 strings->SetString( |
| 193 "setupErrorSyncPhoneState", |
| 194 l10n_util::GetStringUTF16( |
| 195 IDS_EASY_UNLOCK_SETUP_ERROR_SYNC_PHONE_STATE_FAILED)); |
| 196 strings->SetString( |
164 "setupErrorConnectingToPhone", | 197 "setupErrorConnectingToPhone", |
165 l10n_util::GetStringFUTF16( | 198 l10n_util::GetStringFUTF16( |
166 IDS_EASY_UNLOCK_SETUP_ERROR_CONNECTING_TO_PHONE, device_type)); | 199 IDS_EASY_UNLOCK_SETUP_ERROR_CONNECTING_TO_PHONE, device_type)); |
167 | 200 |
168 // TODO(isherman): Remove these strings once the app has been updated. | 201 // TODO(isherman): Remove these strings once the app has been updated. |
169 strings->SetString( | 202 strings->SetString( |
170 "notificationTitle", | 203 "notificationTitle", |
171 l10n_util::GetStringFUTF16(IDS_EASY_UNLOCK_SETUP_NOTIFICATION_TITLE, | 204 l10n_util::GetStringFUTF16(IDS_EASY_UNLOCK_SETUP_NOTIFICATION_TITLE, |
172 device_type)); | 205 device_type)); |
173 strings->SetString( | 206 strings->SetString( |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 if (seek_result.success) { | 363 if (seek_result.success) { |
331 SendResponse(true); | 364 SendResponse(true); |
332 } else { | 365 } else { |
333 SetError(seek_result.error_message); | 366 SetError(seek_result.error_message); |
334 SendResponse(false); | 367 SendResponse(false); |
335 } | 368 } |
336 } | 369 } |
337 | 370 |
338 } // namespace api | 371 } // namespace api |
339 } // namespace extensions | 372 } // namespace extensions |
OLD | NEW |