Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: chrome/browser/ui/sync/sync_promo_ui.cc

Issue 18603006: Bookmark sync promo for Views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improved style Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ui/sync/sync_promo_ui.h" 5 #include "chrome/browser/ui/sync/sync_promo_ui.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #if defined(OS_CHROMEOS) 90 #if defined(OS_CHROMEOS)
91 // There's no need to show the sync promo on cros since cros users are logged 91 // There's no need to show the sync promo on cros since cros users are logged
92 // into sync already. 92 // into sync already.
93 return false; 93 return false;
94 #else 94 #else
95 95
96 // Don't bother if we don't have any kind of network connection. 96 // Don't bother if we don't have any kind of network connection.
97 if (net::NetworkChangeNotifier::IsOffline()) 97 if (net::NetworkChangeNotifier::IsOffline())
98 return false; 98 return false;
99 99
100 // Don't show if the profile is an incognito.
101 if (profile->IsOffTheRecord())
102 return false;
103
Roger Tawa OOO till Jul 10th 2013/07/11 15:28:30 Why do we need this check? We don't suppress othe
fdoray 2013/07/11 19:00:40 SyncPromoUI::ShouldShowSyncPromo is used to determ
104 // Don't show for managed profiles. 100 // Don't show for managed profiles.
105 if (profile->GetPrefs()->GetBoolean(prefs::kProfileIsManaged)) 101 if (profile->GetPrefs()->GetBoolean(prefs::kProfileIsManaged))
106 return false; 102 return false;
107 103
108 // Display the signin promo if the user is not signed in. 104 // Display the signin promo if the user is not signed in.
109 SigninManager* signin = SigninManagerFactory::GetForProfile( 105 SigninManager* signin = SigninManagerFactory::GetForProfile(
110 profile->GetOriginalProfile()); 106 profile->GetOriginalProfile());
111 return !signin->AuthInProgress() && signin->IsSigninAllowed() && 107 return !signin->AuthInProgress() && signin->IsSigninAllowed() &&
112 signin->GetAuthenticatedUsername().empty(); 108 signin->GetAuthenticatedUsername().empty();
113 #endif 109 #endif
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 replacements.ClearQuery(); 262 replacements.ClearQuery();
267 const std::string& locale = g_browser_process->GetApplicationLocale(); 263 const std::string& locale = g_browser_process->GetApplicationLocale();
268 return url.ReplaceComponents(replacements) == 264 return url.ReplaceComponents(replacements) ==
269 GURL(base::StringPrintf(kSyncLandingUrlPrefix, locale.c_str())); 265 GURL(base::StringPrintf(kSyncLandingUrlPrefix, locale.c_str()));
270 } 266 }
271 267
272 // static 268 // static
273 void SyncPromoUI::ForceWebBasedSigninFlowForTesting(bool force) { 269 void SyncPromoUI::ForceWebBasedSigninFlowForTesting(bool force) {
274 g_force_web_based_signin_flow = force; 270 g_force_web_based_signin_flow = force;
275 } 271 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698