- if (reason != REASON_MAX) {
- PostFinishTask(SAFE, reason);
- } else if (!pingback_enabled_) {
- PostFinishTask(SAFE, REASON_PING_DISABLED);
- } else {
- // Currently, the UI only works on Windows so we don't even bother
- // with pinging the server if we're not on Windows. TODO(noelutz):
- // change this code once the UI is done for Linux and Mac.
-#if defined(OS_WIN)
- // The URLFetcher is owned by the UI thread, so post a message to
- // start the pingback.
- BrowserThread::PostTask(
- BrowserThread::UI,
- FROM_HERE,
- base::Bind(&CheckClientDownloadRequest::GetTabRedirects, this));
+
+ if (!pingback_enabled_) {
+ PostFinishTask(UNKNOWN, REASON_PING_DISABLED);
+ return;
+ }
+
+ // Currently, the UI only works on Windows so we don't even bother with
+ // pinging the server if we're not on Windows.
+ // TODO(noelutz): change this code once the UI is done for Linux and Mac.
+#if defined(OS_MACOSX)
+ // TODO(mattm): remove this (see crbug.com/414834).
+ if (base::FieldTrialList::FindFullName("SafeBrowsingOSXClientDownloadPings")
+ != "Enabled") {
+ PostFinishTask(UNKNOWN, REASON_OS_NOT_SUPPORTED);
+ return;
+ }
+#endif
+#if defined(OS_WIN) || defined(OS_MACOSX)
+ // The URLFetcher is owned by the UI thread, so post a message to
+ // start the pingback.
+ BrowserThread::PostTask(
+ BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&CheckClientDownloadRequest::GetTabRedirects, this));