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

Side by Side Diff: chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc

Issue 11881055: Simplify WebUI data sources. Currently WebUI data sources implement a URLDataSourceDelegate interfa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix issue in about_ui exposed by cros tests Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698