| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/feedback_private/feedback_private_api.h" | 5 #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 bool FeedbackPrivateGetStringsFunction::RunSync() { | 150 bool FeedbackPrivateGetStringsFunction::RunSync() { |
| 151 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 151 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 152 | 152 |
| 153 #define SET_STRING(id, idr) \ | 153 #define SET_STRING(id, idr) \ |
| 154 dict->SetString(id, l10n_util::GetStringUTF16(idr)) | 154 dict->SetString(id, l10n_util::GetStringUTF16(idr)) |
| 155 SET_STRING("page-title", IDS_FEEDBACK_REPORT_PAGE_TITLE); | 155 SET_STRING("page-title", IDS_FEEDBACK_REPORT_PAGE_TITLE); |
| 156 SET_STRING("page-url", IDS_FEEDBACK_REPORT_URL_LABEL); | 156 SET_STRING("page-url", IDS_FEEDBACK_REPORT_URL_LABEL); |
| 157 SET_STRING("screenshot", IDS_FEEDBACK_SCREENSHOT_LABEL); | 157 SET_STRING("screenshot", IDS_FEEDBACK_SCREENSHOT_LABEL); |
| 158 SET_STRING("user-email", IDS_FEEDBACK_USER_EMAIL_LABEL); | 158 SET_STRING("user-email", IDS_FEEDBACK_USER_EMAIL_LABEL); |
| 159 #if defined(OS_CHROMEOS) | 159 #if defined(OS_CHROMEOS) |
| 160 // We must check ArcBridgeService::available() before | 160 const arc::ArcAuthService* auth_service = arc::ArcAuthService::Get(); |
| 161 // ArcAuthService::IsArcEnabled() to avoid crashes in browsertests when | 161 if (auth_service && auth_service->IsArcEnabled()) { |
| 162 // |profile_| is not set in ArcAuthService when ARC is not available. | |
| 163 if (arc::ArcBridgeService::Get() && | |
| 164 arc::ArcBridgeService::Get()->available() && | |
| 165 arc::ArcAuthService::Get() && | |
| 166 arc::ArcAuthService::Get()->IsArcEnabled()) { | |
| 167 SET_STRING("sys-info", | 162 SET_STRING("sys-info", |
| 168 IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_AND_METRICS_CHKBOX_ARC); | 163 IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_AND_METRICS_CHKBOX_ARC); |
| 169 } else { | 164 } else { |
| 170 SET_STRING("sys-info", | 165 SET_STRING("sys-info", |
| 171 IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_AND_METRICS_CHKBOX); | 166 IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_AND_METRICS_CHKBOX); |
| 172 } | 167 } |
| 173 #else | 168 #else |
| 174 SET_STRING("sys-info", IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_CHKBOX); | 169 SET_STRING("sys-info", IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_CHKBOX); |
| 175 #endif | 170 #endif |
| 176 SET_STRING("attach-file-label", IDS_FEEDBACK_ATTACH_FILE_LABEL); | 171 SET_STRING("attach-file-label", IDS_FEEDBACK_ATTACH_FILE_LABEL); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 content::RecordAction( | 330 content::RecordAction( |
| 336 base::UserMetricsAction("Feedback.SrtPromptClosed")); | 331 base::UserMetricsAction("Feedback.SrtPromptClosed")); |
| 337 break; | 332 break; |
| 338 default: | 333 default: |
| 339 return RespondNow(Error("Invalid arugment.")); | 334 return RespondNow(Error("Invalid arugment.")); |
| 340 } | 335 } |
| 341 return RespondNow(NoArguments()); | 336 return RespondNow(NoArguments()); |
| 342 } | 337 } |
| 343 | 338 |
| 344 } // namespace extensions | 339 } // namespace extensions |
| OLD | NEW |