| Index: chrome/browser/translate/chrome_translate_client.cc
|
| diff --git a/chrome/browser/translate/chrome_translate_client.cc b/chrome/browser/translate/chrome_translate_client.cc
|
| index ad257ad88d653889fe57ce825df115e77ac88649..87b1151b14c82c7d30483a7f9f319e758d6dd47a 100644
|
| --- a/chrome/browser/translate/chrome_translate_client.cc
|
| +++ b/chrome/browser/translate/chrome_translate_client.cc
|
| @@ -7,6 +7,7 @@
|
| #include <memory>
|
| #include <vector>
|
|
|
| +#include "base/feature_list.h"
|
| #include "base/logging.h"
|
| #include "base/path_service.h"
|
| #include "base/strings/string_split.h"
|
| @@ -31,6 +32,7 @@
|
| #include "chrome/grit/theme_resources.h"
|
| #include "components/metrics/proto/translate_event.pb.h"
|
| #include "components/prefs/pref_service.h"
|
| +#include "components/sync/driver/sync_driver_switches.h"
|
| #include "components/sync/protocol/user_event_specifics.pb.h"
|
| #include "components/sync/user_events/user_event_service.h"
|
| #include "components/translate/core/browser/language_model.h"
|
| @@ -52,6 +54,7 @@
|
| #include "url/gurl.h"
|
|
|
| namespace {
|
| +using base::FeatureList;
|
| using metrics::TranslateEventProto;
|
|
|
| TranslateEventProto::EventType BubbleResultToTranslateEvent(
|
| @@ -78,6 +81,8 @@ TranslateEventProto::EventType BubbleResultToTranslateEvent(
|
| void LogLanguageDetectionEvent(
|
| const content::WebContents* const web_contents,
|
| const translate::LanguageDetectionDetails& details) {
|
| + if (!FeatureList::IsEnabled(switches::kSyncUserLanguageDetectionEvents))
|
| + return;
|
| auto* const profile =
|
| Profile::FromBrowserContext(web_contents->GetBrowserContext());
|
|
|
| @@ -103,6 +108,8 @@ void LogLanguageDetectionEvent(
|
|
|
| void LogTranslateEvent(const content::WebContents* const web_contents,
|
| const metrics::TranslateEventProto& translate_event) {
|
| + if (!FeatureList::IsEnabled(switches::kSyncUserTranslationEvents))
|
| + return;
|
| DCHECK(web_contents);
|
| auto* const profile =
|
| Profile::FromBrowserContext(web_contents->GetBrowserContext());
|
|
|