| 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 16 matching lines...) Expand all Loading... |
| 27 #include "components/feedback/tracing_manager.h" | 27 #include "components/feedback/tracing_manager.h" |
| 28 #include "components/signin/core/browser/signin_manager.h" | 28 #include "components/signin/core/browser/signin_manager.h" |
| 29 #include "components/strings/grit/components_strings.h" | 29 #include "components/strings/grit/components_strings.h" |
| 30 #include "content/public/browser/user_metrics.h" | 30 #include "content/public/browser/user_metrics.h" |
| 31 #include "extensions/browser/event_router.h" | 31 #include "extensions/browser/event_router.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/webui/web_ui_util.h" | 33 #include "ui/base/webui/web_ui_util.h" |
| 34 #include "url/url_util.h" | 34 #include "url/url_util.h" |
| 35 | 35 |
| 36 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
| 37 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 37 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 38 #endif // defined(OS_CHROMEOS) | 38 #endif // defined(OS_CHROMEOS) |
| 39 | 39 |
| 40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
| 41 #include "base/feature_list.h" | 41 #include "base/feature_list.h" |
| 42 #include "chrome/browser/safe_browsing/srt_fetcher_win.h" | 42 #include "chrome/browser/safe_browsing/srt_fetcher_win.h" |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 using extensions::api::feedback_private::SystemInformation; | 45 using extensions::api::feedback_private::SystemInformation; |
| 46 using feedback::FeedbackData; | 46 using feedback::FeedbackData; |
| 47 | 47 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 163 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 164 | 164 |
| 165 #define SET_STRING(id, idr) \ | 165 #define SET_STRING(id, idr) \ |
| 166 dict->SetString(id, l10n_util::GetStringUTF16(idr)) | 166 dict->SetString(id, l10n_util::GetStringUTF16(idr)) |
| 167 SET_STRING("page-title", IDS_FEEDBACK_REPORT_PAGE_TITLE); | 167 SET_STRING("page-title", IDS_FEEDBACK_REPORT_PAGE_TITLE); |
| 168 SET_STRING("additionalInfo", IDS_FEEDBACK_ADDITIONAL_INFO_LABEL); | 168 SET_STRING("additionalInfo", IDS_FEEDBACK_ADDITIONAL_INFO_LABEL); |
| 169 SET_STRING("page-url", IDS_FEEDBACK_REPORT_URL_LABEL); | 169 SET_STRING("page-url", IDS_FEEDBACK_REPORT_URL_LABEL); |
| 170 SET_STRING("screenshot", IDS_FEEDBACK_SCREENSHOT_LABEL); | 170 SET_STRING("screenshot", IDS_FEEDBACK_SCREENSHOT_LABEL); |
| 171 SET_STRING("user-email", IDS_FEEDBACK_USER_EMAIL_LABEL); | 171 SET_STRING("user-email", IDS_FEEDBACK_USER_EMAIL_LABEL); |
| 172 #if defined(OS_CHROMEOS) | 172 #if defined(OS_CHROMEOS) |
| 173 const arc::ArcSessionManager* arc_session_manager = | 173 if (arc::IsArcPlayStoreEnabledForProfile( |
| 174 arc::ArcSessionManager::Get(); | 174 Profile::FromBrowserContext(browser_context()))) { |
| 175 if (arc_session_manager && arc_session_manager->IsArcPlayStoreEnabled()) { | |
| 176 SET_STRING("sys-info", | 175 SET_STRING("sys-info", |
| 177 IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_AND_METRICS_CHKBOX_ARC); | 176 IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_AND_METRICS_CHKBOX_ARC); |
| 178 } else { | 177 } else { |
| 179 SET_STRING("sys-info", | 178 SET_STRING("sys-info", |
| 180 IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_AND_METRICS_CHKBOX); | 179 IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_AND_METRICS_CHKBOX); |
| 181 } | 180 } |
| 182 #else | 181 #else |
| 183 SET_STRING("sys-info", IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_CHKBOX); | 182 SET_STRING("sys-info", IDS_FEEDBACK_INCLUDE_SYSTEM_INFORMATION_CHKBOX); |
| 184 #endif | 183 #endif |
| 185 SET_STRING("attach-file-label", IDS_FEEDBACK_ATTACH_FILE_LABEL); | 184 SET_STRING("attach-file-label", IDS_FEEDBACK_ATTACH_FILE_LABEL); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 content::RecordAction( | 355 content::RecordAction( |
| 357 base::UserMetricsAction("Feedback.SrtPromptClosed")); | 356 base::UserMetricsAction("Feedback.SrtPromptClosed")); |
| 358 break; | 357 break; |
| 359 default: | 358 default: |
| 360 return RespondNow(Error("Invalid arugment.")); | 359 return RespondNow(Error("Invalid arugment.")); |
| 361 } | 360 } |
| 362 return RespondNow(NoArguments()); | 361 return RespondNow(NoArguments()); |
| 363 } | 362 } |
| 364 | 363 |
| 365 } // namespace extensions | 364 } // namespace extensions |
| OLD | NEW |