1eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Copyright 2013 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "chrome/browser/ui/sync/sync_promo_ui.h"
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/profiles/profile.h"
8a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)#include "chrome/browser/signin/signin_promo.h"
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)bool SyncPromoUI::ShouldShowSyncPromo(Profile* profile) {
11a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)  // Don't show sync promo if the sign in promo should not be shown.
12a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)  if (!signin::ShouldShowPromo(profile)) {
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    return false;
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  }
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
16a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)  // Don't show if sync is disabled by policy.
17a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)  if (!profile->IsSyncAccessible())
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    return false;
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  return true;
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
22