| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webui/sync_promo/sync_promo_ui.h" | 5 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 SyncPromoHandler* handler = new SyncPromoHandler( | 96 SyncPromoHandler* handler = new SyncPromoHandler( |
| 97 g_browser_process->profile_manager()); | 97 g_browser_process->profile_manager()); |
| 98 web_ui->AddMessageHandler(handler); | 98 web_ui->AddMessageHandler(handler); |
| 99 | 99 |
| 100 // Set up the chrome://theme/ source. | 100 // Set up the chrome://theme/ source. |
| 101 Profile* profile = Profile::FromWebUI(web_ui); | 101 Profile* profile = Profile::FromWebUI(web_ui); |
| 102 ThemeSource* theme = new ThemeSource(profile); | 102 ThemeSource* theme = new ThemeSource(profile); |
| 103 ChromeURLDataManager::AddDataSource(profile, theme); | 103 ChromeURLDataManager::AddDataSource(profile, theme); |
| 104 | 104 |
| 105 // Set up the sync promo source. | 105 // Set up the sync promo source. |
| 106 ChromeURLDataManager::AddDataSource(profile, CreateSyncUIHTMLSource(web_ui)); | 106 ChromeURLDataManager::AddDataSourceImpl(profile, |
| 107 CreateSyncUIHTMLSource(web_ui)); |
| 107 | 108 |
| 108 sync_promo_trial::RecordUserShownPromo(web_ui); | 109 sync_promo_trial::RecordUserShownPromo(web_ui); |
| 109 } | 110 } |
| 110 | 111 |
| 111 // static | 112 // static |
| 112 bool SyncPromoUI::HasShownPromoAtStartup(Profile* profile) { | 113 bool SyncPromoUI::HasShownPromoAtStartup(Profile* profile) { |
| 113 return profile->GetPrefs()->HasPrefPath(prefs::kSyncPromoStartupCount); | 114 return profile->GetPrefs()->HasPrefPath(prefs::kSyncPromoStartupCount); |
| 114 } | 115 } |
| 115 | 116 |
| 116 // static | 117 // static |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 g_force_web_based_signin_flow; | 308 g_force_web_based_signin_flow; |
| 308 #else | 309 #else |
| 309 return false; | 310 return false; |
| 310 #endif | 311 #endif |
| 311 } | 312 } |
| 312 | 313 |
| 313 // static | 314 // static |
| 314 void SyncPromoUI::ForceWebBasedSigninFlowForTesting(bool force) { | 315 void SyncPromoUI::ForceWebBasedSigninFlowForTesting(bool force) { |
| 315 g_force_web_based_signin_flow = force; | 316 g_force_web_based_signin_flow = force; |
| 316 } | 317 } |
| OLD | NEW |